Quantcast
Channel: Learn C# » c# .net grid control
Viewing all articles
Browse latest Browse all 2

How to execute Stored Procedure in C#

$
0
0

Executing Stored Procedure in C#

SQLCommand Command = new SqlCommand(“StoredProcedureName”, Connection);
Command.CommandType = CommandType.StoredProcedure;
Command.Parameters.Add(new SqlParameter(“@Param1″, comboBox1.Text));

//@Param1-Var Name you declare in Stored Procedure;comboBox1.Text-Value to be passed for that Var
Command.Parameters.Add(new SqlParameter(“@Param2″, textBox1.Text));
Command.Parameters.Add(new SqlParameter(“@Param3″, dateTimePicker1.Value));

Command.ExecuteNonQuery();

Udhaya

PiSquare



Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images