MSDE & Auto Increment

  • Thread starter Thread starter MikeY
  • Start date Start date
M

MikeY

Hiya all,

I'm not exactly sure where to be posting this question, but here goes &
hopefully someone can answer it or re-direct me.

I'm building a windows form application in C#. I am using MSDE I've imported
my Access.mdb & set up the Identity, Identity Seed, & Identity Increment. I
want to be able to add a new entries (rows), but the problem arises because
update won't work until I input a number or update my ID field first. I
don't want to see this ID field on my form that is being incremented or to
have the user deal with inputting this number. When I manually (directly) go
in and add data to my field, the ID field does not update till I insert text
into the next row (another new row) following it. This problem does not
happen when I directly access access.mdb itself.

The following is a sample of my code which seems to be correct as does my
Identity, Identity Seed, & Identity Increment :

DataRow thisRow = dsAddError1.Tables["Error Log"].NewRow();

dsAddError1.Tables["Error Log"].Rows.Add(thisRow);

sqlDataAdapter1.Update(dsAddError1, "Error Log");

Any and all suggestions tips are appreciated. Thank you all in advance.

MikeY
 
Thanks all but I found my solution. Being a newbie it was a syntex error all
along. I was missing "this" from this.sqlDataAdapter1.Update(dsAddError1,
"Error Log");
 
Back
Top