private void InquiryUpdatebutton_Click(object sender, EventArgs e) { try { SqlConnection con = new SqlConnection(@"Data Source=.;Initial Catalog=lingo_Database;Integrated Security=True"); con.Open(); SqlCommand cmd = new SqlCommand("update Inquiry_Table set Inquiry_Date='" + InquirydateTimePicker.Text + "',Attendant='" + InquiryAttendantcomboBox.Text + "',Program='" + InquiryProgramcomboBox.Text + "',Course_Name='" + InquiryCourseNamecomboBox.Text + "',Student_Name='" + InquiryStudentNametextBox.Text + "',Phone='" + InquiryPhonetextBox.Text + "',Potential='" + InquiryPotentialcomboBox.Text + "',Expected_Strength='" + InquiryExpectedStrengthcomboBox.Text + "',Know_About='" + InquiryHowKnowcomboBox.Text + "',Expected_Visit_Date='" + InquiryVisitdateTimePicker.Text + "',Day='" + InquiryDaycomboBox.Text + "',Comments='" + InquiryCommentstextBox.Text + "',Teacher_Name='" + InquiryTeacherNamecomboBox.Text + "',Demo_Class='" + InquiryDemoClasscomboBox.Text + "',Follow_1='" + InquiryFollow1comboBox.Text + "',Follwer_1_Name='" + InquiryFollowerName1comboBox.Text + "',Follower_1_Response='" + InquiryResponse1comboBox.Text + "',Follower_Date_1='" + Follower1dateTimePicker.Text + "',Follow_2='" + InquiryFollow2comboBox.Text + "',Follwer_2_Name='" + InquiryFollowerName2comboBox.Text + "',Follower_2_Response='" + InquiryResponse2comboBox.Text + "',Follower_Date_2='" + Follower2dateTimePicker.Text + "',Follow_3='" + InquiryFollow3comboBox.Text + "',Follwer_3_Name='" + InquiryFollowerName3comboBox.Text + "',Follower_3_Response='" + InquiryResponse3comboBox.Text + "',Follower_Date_3='" + Follower3dateTimePicker.Text + "',Pending_Done_Cencal='" + InquiryPendingDonecomboBox.Text + "',Expected_Fee='" + InquiryExpectedFeetextBox.Text + "' where Inquiry_No='" + InquiryNotextBox.Text + "'", con); cmd.ExecuteNonQuery(); MessageBox.Show("Data Updated into Database."); SqlCommand cmd0 = new SqlCommand("select COUNT(Inquiry_No) from Inquiry_Table", con); int TotalInquiry = Convert.ToInt32(cmd0.ExecuteScalar()); TotalInquirylabel.Text = TotalInquiry.ToString(); SqlCommand cmd1 = new SqlCommand("select COUNT(Inquiry_No) from Inquiry_Table where Pending_Done_Cencal='Pending'", con); int InquiryPending = Convert.ToInt32(cmd1.ExecuteScalar()); InquiryPendinglabel.Text = InquiryPending.ToString(); SqlCommand cmd3 = new SqlCommand("select COUNT(Inquiry_No) from Inquiry_Table where Pending_Done_Cencal='Cancel'", con); int InquiryCancel = Convert.ToInt32(cmd3.ExecuteScalar()); InquiryCancellabel.Text = InquiryCancel.ToString(); if (InquiryPendingDonecomboBox.Text == "Done") { Admission_Form s = new Admission_Form(); s.Show(); } } catch { MessageBox.Show("Data is not update."); } }
private void AdmissionFrombutton_Click(object sender, EventArgs e) { Admission_Form s = new Admission_Form(); s.Show(); }