reg:stored procedure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Satheesh Kumar

    reg:stored procedure

    how to insert values into stored procedure....
    using vb.net application....
    if any one knows send me the sample code... for that insert query

  • Mark R. Dawson

    #2
    RE: reg:stored procedure

    You should post your question to the VB.Net newsgroup, this one is for C#.

    Mark.
    --



    "Satheesh Kumar" wrote:
    how to insert values into stored procedure....
    using vb.net application....
    if any one knows send me the sample code... for that insert query
    >
    >

    Comment

    • Ciaran O''Donnell

      #3
      RE: reg:stored procedure

      In C# the answer is

      for stored proc like :
      -----------------
      Create Procedure SelectById
      (
      @ID int
      )
      AS

      Select * from MyTable Where [ID] = @ID
      ----------------

      the code would be:

      string connectionStrin g = "" // Put connection string here
      using (SqlConnection conn = new SqlConnection(c onnectionString )){
      using(SqlComman d sqlcom = new SqlCommand("Sel ectById",conn)) {
      sqlcom.CommandT ype = CommandType.Sto redProcedure;
      sqlcom.Paramete rs.Add("@ID",Sq lDbType.Int).Va lue = 1; //the value to
      pass in
      SqlDataReader reader = sqlcom.ExecuteR eader();
      //Do something here with results
      }
      }

      HTH - SharpDevelop and convert C# to VB.NET

      Ciaran O'Donnell

      "Satheesh Kumar" wrote:
      how to insert values into stored procedure....
      using vb.net application....
      if any one knows send me the sample code... for that insert query
      >
      >

      Comment

      Working...