We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WinForms
Category : Data Binding

How do I call a SQL stored procedure?

You can call stored procedures in basically the same manner as executing other SQL commands.

When creating the SqlCommand, set the query string to be the name of the stored procedure, and then set the CommandType to be CommandType.StoredProcedure. After you setup the command type, you need to pass in any parameters required for the stored procedure. Here is an example of one input and one output parameter. If the stored procedure is returning a selection query at the end, you can fill your DataSet and retrieve any tables. Or, if no tables are being returned, you can execute the command as a non-query

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon