<br /> "ExecuteNonQuery: CommandText property has not been initialized".
namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string conn = "Data Source=.;Initial Catalog=LearningSP;Integrated Security=True"; SqlConnection con = new SqlConnection(conn); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@rollno",100)); cmd.Connection = con; cmd.ExecuteNonQuery(); con.Close(); } } }
cmd.CommandText = "sampleproc";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)