469,271 Members | 1,494 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Column PatientNo does not allow nulls

Jim
I am trying to add records to a table using a windows form created in vb with
a dataset object. I have dragged and dropped the fields I want onto my form.
A BindingNavigator is created and am trying to add a new record. I click the
add button, fill out the necessary fields and attempt to update the record. I
get the above error.

The PatientNo field is a seeded identity field that is indexed in the table
and therefore can not be null. I understand that.......... When I add a new
record directly to the database no problem, not using my program, the
PatientNo field is incremented and seeded correctly.

However when I try to update the record using the program the first line
below generates the does not allow null error.

Private Sub PatientBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
PatientBindingNavigatorSaveItem.Click

Me.Validate()

Me.PatientBindingSource.EndEdit()

Me.PatientTableAdapter.Update(Me.DataSet1.Patient)

End Sub

How do I stop the error from occuring and get my database updated?

A little frustrating to say the least.

Thanks,

--
Thanks, Jim
Dec 29 '05 #1
0 919

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Robert Stearns | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.