try { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["masthanConnectionString"].ConnectionString); con.Open(); string str = "select count(*) from productdetails where Title='cars'"; SqlCommand cmd = new SqlCommand(str, con); //cmd.Parameters.AddWithValue("cmd",con); Label1.Text = cmd.ExecuteNonQuery().ToString(); //cmd.ExecuteNonQuery(); con.Close(); } catch { //Label1.Text = ""; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)