12-01-21, 08:44 PM
Try
cmd = New SqlCommand("insert into table0 values ('" & TextBox1.Text & "'," & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & " ' ) ", con)
Me.FillDataGridView("Select * From Table0")
con.Open()
cmd.ExecuteNonQuery()
MsgBox("all data saved", MsgBoxStyle.Information)
dt.Clear()
Me.FillDataGridView("Select * From Table0")
MessageBox.Show("تم حفظ البيانات بنجاح", "تم الحفظ", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MsgBox(ex.Message)
End Try
cmd = New SqlCommand("insert into table0 values ('" & TextBox1.Text & "'," & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & " ' ) ", con)
Me.FillDataGridView("Select * From Table0")
con.Open()
cmd.ExecuteNonQuery()
MsgBox("all data saved", MsgBoxStyle.Information)
dt.Clear()
Me.FillDataGridView("Select * From Table0")
MessageBox.Show("تم حفظ البيانات بنجاح", "تم الحفظ", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MsgBox(ex.Message)
End Try