Add SQL parameter at run time using store procedure in c#


Code for add SQL Parameter at run time using store procedure in c#

SqlConnection connection;
SqlCommand command = new SqlCommand();
string connectionstring;
SqlParameter paraName = new SqlParameter();
public void addparameter(string prameterName, string prameterValue)
{
paraName.ParameterName = prameterName;
paraName.Value = prameterValue;
command.Parameters.Add(paraName);
}
Advertisements

One thought on “Add SQL parameter at run time using store procedure in c#

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s