SqlDataAdapter sda = new SqlDataAdapter("select scode from result where Enrollno ='" + Label7.Text + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
int c = dt.Rows.Count;
if (c != 0)
{
Label8.Text ="Sorry You Have been already Given Exam";
}
SqlCommand cmd = new SqlCommand("insert into result(Enrollno,scode,TotalQuestion,TotalCorrectAnswer,TotalWrongAnswer,Examdate) values (" + Label7.Text + ",'" + DropDownList1.Text + "','" + a + "','" + count + "','" + b + "','" + Label5.Text + "')", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();