hi,,
how to handle exceptionhnadling for the below code..........any one can plz help me...............
String cs31 = ("server=ABCD;database=abc;uid=sa;pwd=abc");
SqlConnection con31 = new SqlConnection(cs31);
con31.Open();
SqlCommand cmd131 = new SqlCommand("select count(*) from course where coursename='" + textcname.Text + "'", con31);
int y = (int)cmd131.ExecuteScalar();
if (y == 1)
{
label3.Text = "CourseName Already Exits...";
return;
}
con31.Close();
these code shoul handle in exception...