kamagra how much to take

AspnetSchemaversionsCommands Partial Class

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

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