MyCode is :
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
con.Open();
query = "EmpLogin";
SqlCommand cmd = new SqlCommand(query,con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@UserName", txtUserName.Text.ToString());
cmd.Parameters.AddWithValue("@Password", txtPassword.Text.ToString());
int usercount = (Int32)cmd.ExecuteScalar();
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Krishna GaradPosted Jan 15, 2013, 12:58 AM
cmd.CommandType = CommandType.StoreProcedure;
Deepali PatilPosted Jan 15, 2013, 1:36 AM
It works.