Having spent a lot of time Googling over the last 2 days, this seems
like a common problem, but I havent run into any answers:

My VB.Net front end loads data from an Access database successfully,
and navigation works fine. However, I cannot add a record. Code is as
follows:

In my Add New Record button:

REM move to last record
Call btnLast_Click(Nothing, Nothing)
REM clear text boxes, prepare for new record
Me.BindingContext(DsAppointments1, "Appointments").AddNew()

In my Update button:

REM commit to adding new record
Me.BindingContext(DsAppointments1, "Appointments").EndCurrentEdit()

When that last line of code fires, I get the following error (I know
this must be starting to look familiar to experienced coders):

--------------
"An unhandled exception of type 'System.Data.NoNullAllowedException'
occurred in system.data.dll

Additional information: Column 'Appt_ID' does not allow nulls."
--------------

Appt_ID is the primary key and is set to autonumber in the Access
database. I have tried too many things to even mention here, but I
cannot get this to work. I'm sure someone out there has gotten it to
work, and I'd love to know how. :-)

Also, a curiosity. What is the VB.Net equivelent of:
Adodc1.Recordset.Fields(0).Value

Thanks, Tony

Re: ADO.NET AddNew EndCurrentEdit & "Column 'Appt_ID' does not allow nulls" by Cor

Cor
Wed Sep 28 02:27:38 CDT 2005

Tony,

I am not sure anymore, I thought that this one resolved your problem.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatamissingschemaactionclasstopic.asp

Although adding these is as well not bad (see the sample to get it complete)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatacolumnclassautoincrementsteptopic.asp

I hope this helps,

Cor

<tony010409020622@spamthis@hotmail.com> schreef in bericht
news:uftjj1t1kkmd0n7utknvjein8ucc6i6os0@4ax.com...
>
> Having spent a lot of time Googling over the last 2 days, this seems
> like a common problem, but I havent run into any answers:
>
> My VB.Net front end loads data from an Access database successfully,
> and navigation works fine. However, I cannot add a record. Code is as
> follows:
>
> In my Add New Record button:
>
> REM move to last record
> Call btnLast_Click(Nothing, Nothing)
> REM clear text boxes, prepare for new record
> Me.BindingContext(DsAppointments1, "Appointments").AddNew()
>
> In my Update button:
>
> REM commit to adding new record
> Me.BindingContext(DsAppointments1, "Appointments").EndCurrentEdit()
>
> When that last line of code fires, I get the following error (I know
> this must be starting to look familiar to experienced coders):
>
> --------------
> "An unhandled exception of type 'System.Data.NoNullAllowedException'
> occurred in system.data.dll
>
> Additional information: Column 'Appt_ID' does not allow nulls."
> --------------
>
> Appt_ID is the primary key and is set to autonumber in the Access
> database. I have tried too many things to even mention here, but I
> cannot get this to work. I'm sure someone out there has gotten it to
> work, and I'd love to know how. :-)
>
> Also, a curiosity. What is the VB.Net equivelent of:
> Adodc1.Recordset.Fields(0).Value
>
> Thanks, Tony



Re: ADO.NET AddNew EndCurrentEdit & "Column 'Appt_ID' does not allow nulls" by tony010409020622

tony010409020622
Wed Sep 28 16:40:43 CDT 2005


On Wed, 28 Sep 2005 09:27:38 +0200, "Cor Ligthert [MVP]"
<notmyfirstname@planet.nl> wrote:

>Tony,
>
>I am not sure anymore, I thought that this one resolved your problem.
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatamissingschemaactionclasstopic.asp
>


You must be thinking of someone else, I haven't posted in this
newsgroup before. :) But I will check it out, thank you.