protected void
Button2_Click(object sender, EventArgs e)
{
cmd = new SqlCommand("select count(id) from std", con);
con.Open();
int c = Convert.ToInt32(cmd.ExecuteScalar());//ExecuteScalar is use when you want single value result like number of rows, total of salary average etc.
Response.Write("total
no of records are : " + c);
}
No comments:
Post a Comment