public void E_Delete() { string query = "delete Question_sheet where question_num ='" + Q_no + "'"; SqlCommand SC = new SqlCommand(query, Connection_cls.Get()); SC.ExecuteNonQuery(); }
// edit english questions public void E_EDIT() { string query = "Update English_Question_sheet set Question ='" + new_Question + "', option_a='" + a + "', option_b='" + b + "', option_c='" + c + "',option_d = '" + d + "',correct_ans ='" + Correct_ans + "' where Question_num ='" + Q_no + "'"; SqlCommand SC = new SqlCommand(query, Connection_cls.Get()); SC.ExecuteNonQuery(); }
public void E_ADD() { string query = "insert into English_Question_sheet values('" + new_Question + "','" + a + "','" + b + "','" + c + "','" + d + "','" + Correct_ans + "')"; SqlCommand SC = new SqlCommand(query, Connection_cls.Get()); SC.ExecuteNonQuery(); }
public void ADD() { string query = "insert into tbl_Login values('" + Login_ID + "','" + Login_Pass + "','" + T_Marks + "','" + Type + "') "; SqlCommand SC = new SqlCommand(query, Connection_cls.Get()); SC.ExecuteNonQuery(); }
private void button2_Click(object sender, EventArgs e) { SqlDataAdapter adpt = new SqlDataAdapter("select * from Question_sheet", Connection_cls.Get()); DataTable dt = new DataTable(); adpt.Fill(dt); dataGridView1.DataSource = dt; // Connection_cls.Get().Close(); }
//search for English Questions public void E_Search() { string query = "select * from English_Question_sheet where Question_num ='" + Q_no + "'"; SqlCommand SC = new SqlCommand(query, Connection_cls.Get()); SqlDataReader sdr = SC.ExecuteReader(); while (sdr.Read()) { new_Question = sdr["Question"].ToString(); a = sdr["option_a"].ToString(); b = sdr["option_b"].ToString(); c = sdr["option_c"].ToString(); d = sdr["option_d"].ToString(); Correct_ans = sdr["correct_ans"].ToString(); } sdr.Close(); }
public void show_ques() { string query = "select * from English_Question_sheet where Question_num = '" + Question_num + "'"; SqlCommand SC = new SqlCommand(query, Connection_cls.Get()); SC.ExecuteNonQuery(); SqlDataReader sdr = SC.ExecuteReader(); while (sdr.Read()) { Question = (string)sdr["Question"]; option_a = (string)sdr["option_a"]; option_b = (string)sdr["option_b"]; option_c = (string)sdr["option_c"]; option_d = (string)sdr["option_d"]; correct_ans = (string)sdr["correct_ans"]; } sdr.Close(); }
public SqlConnection Request(SqlConnection req) { SqlConnection con = Connection_cls.Get(req); return(con); }