kamagra how much to take

AspnetPathsCommands Partial Class

This command factory creates static partial classes that generate parameterized database commands to the ASP.NET database, in this case the “paths” 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 AspnetPaths objects.
  22.         /// </summary>
  23.         internal static partial class AspnetPathsCommands
  24.         {
  25.                 /// <summary>
  26.                 /// Finds all AspnetPaths objects with a certain Applicationid value.
  27.                 /// </summary>
  28.                 /// <param name="applicationid">The Applicationid value.</param>
  29.                 /// <returns>An IDbCommand that finds all AspnetPaths objects with a certain Applicationid value.</returns>
  30.                 public static IDbCommand FindByApplicationid(Guid applicationid)
  31.                 {
  32.                         SqlCommand cmd;
  33.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Paths] where [ApplicationId] = @applicationid");
  34.                         cmd.Parameters.AddWithValue("@applicationid", applicationid);
  35.                         return cmd;
  36.                 }
  37.  
  38.                 /// <summary>
  39.                 /// Finds all AspnetPaths objects with a certain Path value.
  40.                 /// </summary>
  41.                 /// <param name="path">The Path value ('*' can be used as a wildcard).</param>
  42.                 /// <returns>An IDbCommand that finds all AspnetPaths objects with a certain Path value.</returns>
  43.                 public static IDbCommand FindByPath(string path)
  44.                 {
  45.                         SqlCommand cmd;
  46.                         if (path == null)
  47.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Paths] where [Path] is null");
  48.                         else
  49.                         {
  50.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Paths] where [Path] like @path");
  51.                                 cmd.Parameters.AddWithValue("@path", path.Replace("*", "%"));
  52.                         }
  53.                         return cmd;
  54.                 }
  55.  
  56.                 /// <summary>
  57.                 /// Finds all AspnetPaths objects with a certain Loweredpath value.
  58.                 /// </summary>
  59.                 /// <param name="loweredpath">The Loweredpath value ('*' can be used as a wildcard).</param>
  60.                 /// <returns>An IDbCommand that finds all AspnetPaths objects with a certain Loweredpath value.</returns>
  61.                 public static IDbCommand FindByLoweredpath(string loweredpath)
  62.                 {
  63.                         SqlCommand cmd;
  64.                         if (loweredpath == null)
  65.                         cmd = new SqlCommand("select * from [dbo].[aspnet_Paths] where [LoweredPath] is null");
  66.                         else
  67.                         {
  68.                                 cmd = new SqlCommand("select * from [dbo].[aspnet_Paths] where [LoweredPath] like @loweredpath");
  69.                                 cmd.Parameters.AddWithValue("@loweredpath", loweredpath.Replace("*", "%"));
  70.                         }
  71.                         return cmd;
  72.                 }
  73.  
  74.         }
  75. }
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>