Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Send sp parameters regardless of sequence

Send sp parameters regardless of sequence

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsharepointdatabasetutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mmdullah
    wrote on last edited by
    #1

    Hi, all would you please show me how to call following sp from asp.net say the TEST sp is as follows takes the following parameters: @ID , @MeetingID, @Title how can I call this from c# (code behind file) in the folowing fashion TEST @ID=intID,@MeetingID=intMID,@Title=strTitle or TEST @Title=strTitle,@ID=intID,@MeetingID=intMID or TEST @Title=strTitle,@MeetingID=intMID,@ID=intID NOTE: All of these statement execute successfully from query analyzer. Thanks in advance.

    S 1 Reply Last reply
    0
    • M mmdullah

      Hi, all would you please show me how to call following sp from asp.net say the TEST sp is as follows takes the following parameters: @ID , @MeetingID, @Title how can I call this from c# (code behind file) in the folowing fashion TEST @ID=intID,@MeetingID=intMID,@Title=strTitle or TEST @Title=strTitle,@ID=intID,@MeetingID=intMID or TEST @Title=strTitle,@MeetingID=intMID,@ID=intID NOTE: All of these statement execute successfully from query analyzer. Thanks in advance.

      S Offline
      S Offline
      sashidhar
      wrote on last edited by
      #2

      Just add the parameters below As it is a store procedure all you have to do is to send the params to the SP..!

      public static bool Update_Driver(int ID, int MeetingID, string Title)
      {

              bool result = false;
              SqlCommand command = new SqlCommand("Your Store ProcedureName", YourConnection);
              command.CommandType = System.Data.CommandType.StoredProcedure;
              command.Parameters.AddWithValue("@ID", ID);
              command.Parameters.AddWithValue("@MeetingID", MeetingID);
              command.Parameters.AddWithValue("@Title", Title);
              command.Connection.Open();
              // result = Convert.ToBoolean(Command.ExecuteNonQuery());
              try
              {
                  result = Convert.ToBoolean(command.ExecuteNonQuery());
              }
              catch (Exception ie)
              {
                 
              }
              command.Connection.Close();
              command.Connection.Dispose();
      
              return result;
          }
      

      LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups