Hi!
I have a code that saves data to access database. But I can't figure out how to make it work when a field is left blank.
How should I edit my code so that it allows to save even when some of the textboxes are left empty?
I have a code that saves data to access database. But I can't figure out how to make it work when a field is left blank.
Code:
MainForm.RihmatabelTableAdapter.Insert(Me.ComboProfiil.Text, Me.PikkusTextBox.Text, _
Me.OriginaaltoodeCheckBox.Checked.ToString, Me.OriginaalkoodTextBox.Text, _
Me.TootekoodTextBox.Text, Me.SobivusTextBox.Text, Me.ForgardenCheckBox.Checked.ToString, _
Me.ReginettCheckBox.Checked.ToString, Me.VärvusTextBox.Text, Me.HindTextBox.Text, _
Me.MärkmedTextBox.Text)
MainForm.RihmatabelTableAdapter.Fill(MainForm.RihmadDataSet.Rihmatabel)
MsgBox("Uus toode lisatud!", MsgBoxStyle.Information, "Rihmade Andmebaas")
How should I edit my code so that it allows to save even when some of the textboxes are left empty?