Steps involve in execution of stored procedure.

  • Create a command object.
  • Specify the store procedure name.

    Cmd.CommandText = "nameOfStoredProc";

  • Set the CommandType property of the command object to the CommandType.StoredPrcedure enumeration value.

    Cmd.CommandType = CommandType.StoredProcedure;

  • Declare parameters and configure the values for the parameters.

    SqlDBParameter = p1, p2;

    p1 = Cmd.Parameters.Add ("nameOfParameter", SqlDbType.Integer);

    p1.Direction = ParameterDirection.Input;

    p1.Value = value;

  • Execute the command object

    Cmd.ExecuteReader ();

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger