what's really ennoying me, is that the same code is working well on the users' subwindow, whenever i insert new data, the table is well updated :'(
here is the users' code, which works well!! wouldu like to tell me what's the difference?
Private Sub ButtnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtnSaveU.Click
ButnNewU.Enabled = True
cmbxUFindby.Enabled = True
sql = "select * from user"
cmd = New MySqlCommand(sql)
dataadapt = New MySqlDataAdapter(cmd)
datset = New DataSet
cmd.Connection() = cn
dataadapt.Fill(datset, "user")
datatab = datset.Tables("user")
If txtEmail.Text = "" Or txtname.Text = "" Or txtshrtname.Text = "" Or txtsecretan.Text = "" Or txtsecretq.Text = "" Or cmbxgovern.Text = "" Or cmbxmaritstat.Text = "" Or txtphone.Text = "" Or cmbxsex.Text = "" Or txtadress.Text = "" Then
MsgBox("Please fill in all fields !", MsgBoxStyle.Information, "Information")
Else
datrow = datset.Tables("user").NewRow
datrow("name") = txtname.Text
datrow("shortname") = txtshrtname.Text
datrow("address") = txtadress.Text
datrow("phonenumber") = CInt(txtphone.Text)
datrow("Secret_Question") = txtsecretq.Text
datrow("Secret_Answer") = txtsecretan.Text
datrow("email") = txtEmail.Text
datrow("sex") = cmbxsex.Text
datrow("maritalstatus") = cmbxmaritstat.Text
datrow("country") = cmbxgovern.Text
datset.Tables("user").Rows.Add(datrow)
cmdb = New MySqlCommandBuilder(dataadapt)
dataadapt.Update(datset, "user")
datset.Clear()
dataadapt.Fill(datset, "user")
datatab = datset.Tables("user")
txtEmail.Text = ""
txtadress.Text = ""
txtname.Text = ""
txtshrtname.Text = ""
txtsecretan.Text = ""
txtsecretq.Text = ""
cmbxsex.Text = ""
cmbxgovern.Text = ""
cmbxmaritstat.Text = ""
txtphone.Text = ""
ButnNewU.Enabled = True
ButtnSaveU.Enabled = False
End If
End Sub