kamagra how much to take

AspnetApplicationsCommands Partial Class

This command factory creates static partial classes that generate parameterized database commands to the ASP.NET database, in this case the “applications” table. This partial class could be extended to include your own queries if you desired.

  1.  
  2.  
  3. //*****************************************************************************
  4. // This file is part of the data access layer example to the ASP.NET 2.0 provider database
  5. // This file was written by Adam Buenz [WSS MVP] of ARB Security Solutions, LLC
  6. // <a href="http://www.sharepointsecurity.com">http://www.sharepointsecurity.com</a>
  7. //
  8. // This file and its parts is free for re-distribution, for use in both free
  9. // and commercial applications, however this header must remain intact for legal
  10. // use. The data access layer example is distributed in the hope that it will
  11. // be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. //*****************************************************************************
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Text;
  17. using System.Data;
  18. using System.Data.SqlClient;
  19.  
  20. namespace Aspnet.Provider.Datalayer.Commands
  21. {
  22. ///
  23. /// A command factory class for AspnetApplications objects.
  24. ///
  25. internal static partial class AspnetApplicationsCommands
  26. {
  27. ///
  28. /// Finds all AspnetApplications objects with a certain Applicationname value.
  29. ///
  30. ///The Applicationname value ('*' can be used as a wildcard).
  31.  
  32. /// An IDbCommand that finds all AspnetApplications objects with a certain Applicationname value.
  33.  
  34. public static IDbCommand FindByApplicationname(string applicationname)
  35. {
  36. SqlCommand cmd;
  37. if (applicationname == null)
  38. cmd = new SqlCommand("select * from [dbo].[aspnet_Applications] where [ApplicationName] is null");
  39. else
  40. {
  41. cmd = new SqlCommand("select * from [dbo].[aspnet_Applications] where [ApplicationName] like @applicationname");
  42. cmd.Parameters.AddWithValue("@applicationname", applicationname.Replace("*", "%"));
  43. }
  44. return cmd;
  45. }
  46. /// Finds all AspnetApplications objects with a certain Loweredapplicationname value.
  47. ///
  48. ///The Loweredapplicationname value ('*' can be used as a wildcard).
  49.  
  50. /// An IDbCommand that finds all AspnetApplications objects with a certain Loweredapplicationname value.
  51. public static IDbCommand FindByLoweredapplicationname(string loweredapplicationname)
  52. {
  53. SqlCommand cmd;
  54. if (loweredapplicationname == null)
  55. cmd = new SqlCommand("select * from [dbo].[aspnet_Applications] where [LoweredApplicationName] is null");
  56. else
  57. {
  58. cmd = new SqlCommand("select * from [dbo].[aspnet_Applications] where [LoweredApplicationName] like @loweredapplicationname");
  59. cmd.Parameters.AddWithValue("@loweredapplicationname", loweredapplicationname.Replace("*", "%"));
  60. }
  61. return cmd;
  62. }
  63.  
  64. ///
  65. /// Finds all AspnetApplications objects with a certain Description value.
  66. ///
  67. /// The Description value ('*' can be used as a wildcard). /// An IDbCommand that finds all AspnetApplications objects with a certain Description value.
  68. public static IDbCommand FindByDescription(string description)
  69. {
  70. SqlCommand cmd;
  71. if (description == null)
  72. cmd = new SqlCommand("select * from [dbo].[aspnet_Applications] where [Description] is null");
  73. else
  74. {
  75. cmd = new SqlCommand("select * from [dbo].[aspnet_Applications] where [Description] like @description");
  76. cmd.Parameters.AddWithValue("@description", description.Replace("*", "%"));
  77. }
  78. return cmd;
  79. }
  80.  
  81. }
  82. }
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>