471,573 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,573 software developers and data experts.

Column PatientNo does not allow nulls - help

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 30 '05 #1
0 915

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 XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.