Click here to Skip to main content
15,915,833 members

Comments by Member 15751945 (Top 5 by date)

Member 15751945 1-Sep-22 0:53am View    
now INSERT is working perfectly , new error appeared with datagridview .
Member 15751945 31-Aug-22 8:53am View    
thanks really for sharing , although I successfully excecated the insert statement , my senario is to add the data of the statment inot DGV and edit and delete from the dgv displayed , i faced this error.datagridview default error dialog system.argumentexception parameter is not valid
Member 15751945 31-Aug-22 2:11am View    
thanks for your explanation , although I am not familiar with queries parameterization, i noticed in many tutorials using my way of writing queries and is executing .
Member 15751945 30-Aug-22 8:05am View    
I retyped it to this :

EmpName this.textBox_EmpName.Text
RegNo this.textBox_RegNo
Job_Title this.textBox_JopTitle.Text
Position this.textBox_Position.Text
Hiring_Date this.dateTimePicker_hd.Text
Country this.Cbox_Country.Text
Birthdate this.dateTimePicker_bd.Text
Gender this.comboBox_Gender.Text
Phone this.textBox_phone.Text
Address this.textBox_Address.Text
Photo this.pictureBox_employee.Image
DeptID this.comboBox_Dept.Text

Member 15751945 30-Aug-22 4:43am View    
I change the dates into this :
string query ="INSERT INTO employee_table(EmpName,RegNo,Job_Title,Position,Hiring_Date,Country,Birthdate,Gender,Phone,Address,Photo,DeptID)Values('" + this.textBox_EmpName.Text + "','" + this.textBox_JopTitle.Text + "','" + this.textBox_Position.Text + "','" + this.comboBox_Dept.Text + "','" + this.Cbox_Country.Text + "','" + this.dateTimePicker_hd.Text + "','" + this.textBox_phone.Text + "','" + this.textBox_RegNo.Text + "','" + this.dateTimePicker_bd.Text+ "','" + this.textBox_Address.Text + "','" + this.pictureBox_employee.Image + "')";