Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27193

VS 2010 Save empty fields to access database.

$
0
0
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.

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?

Viewing all articles
Browse latest Browse all 27193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>