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();
}





Vindhya YadaavPosted Dec 3, 2015, 5:13 AM
create table result
(
Enrollno int,
scode varchar (20),
TotalQuestion varchar (20),
TotalCorrectAnswer varchar (20),
TotalWrongAnswer varchar (20),
TotalTime varchar(30),
Examdate varchar (30)
);
Rajeesh MenothPosted Dec 2, 2015, 5:48 AM
Jignesh TrivediPosted Dec 2, 2015, 5:22 AM
Vindhya YadaavPosted Dec 2, 2015, 2:00 AM