473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

OleDbAdapter.InsertCommand and autoincrement IDs problem

I use OleDbAdapter to fill my dataset from Access database and tables with autoincrement id columns.Also i created xsd schema for my dataset

The problem is that the dataset automatically add neu unique ID which is not correspond to realy added record ID in the database
For exp. in database i have
ID Name Titl
10 john some tex
12 peter .......
ds.Table1Row newrow=ds.Table1.NewTable1Row(
newRow.Name = some name
newRow.Title = some new title
..
ds.Table1.AddTable1Row(newRow)
oledbAdapter1.Update(ds.Table1)
In this moment Dataset automatically add ID = 13 for the new record, which is not correct, in case some others records are deleted before in database after record with ID 12
My question is it possible to write InsertCommand like in SqlAdapter insert command
in one sentence Insert and Select clause included select @@IDENTITY and returns correct ID
Thanks for any help.
Nov 16 '05 #1
1 3909
Until now i didn't receive an answer of my question, how to resolve incorrect autoincrement data in disconected dataset when it is MSAccess database . Fortunatlly I find the answer myself.
If someone has the same problem, please look on http://www.codeproject.com/cs/databa...ionaladonet.as

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marko Maehner | last post by:
Hi, I have a strange problem with my xml file. In the schema of this xml file I have set one column to autoincrement. When I enter the data in my xml file directly, the autoincrement-column gets...
0
by: Ivaylo | last post by:
I use OleDbAdapter to fill my dataset from Access database and tables with autoincrement id columns.Also i created xsd schema for my dataset The problem is that the dataset automatically add neu...
1
by: Luboą ©lapák | last post by:
Hi, I need define InsertCommand in SQLDataAdapter, but I don't know how. Please Help me. I don't know the format of InsertCommand. Thanks
0
by: Pavel Gusak | last post by:
I'm trying to update Access database with data from DataSet in my Web Service. Does not work. Generates Concurrency violation error, however, nobody works with db at the time. Can you help me?...
6
by: Dennis | last post by:
I have set a DataTable and one of the columns I set "AutoIncrement" to True. I then populate the Table by setting the columns to values then add the row to the table. I inadverently set the...
6
by: Michael | last post by:
I am trying to create an access database within Net 2003 using the ADOX library which works fine except when I try to add the AutoIncrement property to the ContactId column. I am experiencing a...
3
by: MP | last post by:
context: vb6/ ado / .mdb format / jet 4.0 (not using Access - ADO only) - creating tables via ADO (don't have access) - all tables have a primary key (PK) - many of the PK will become FK(Foreign...
3
by: Rich | last post by:
What is the diffeence bewtween a dataAdapter.InsertCommand and dataAdapter.SelectCommand (and dataAdapter.UpdateCommand for that matter)? Dim da As SqlDataAdapter conn.Open da.SelectCommand =...
4
by: Tim | last post by:
Hello All, I could use some help on an error that is just now popping it's head up. Seems that the autoincrement numeric has hit 32,767. The autoincrement is used in various locations in the...
2
by: BobLewiston | last post by:
I can read in an SQL table ("Person.Contact") from AdventureWorks and step through it one row at a time, but when I try to save a record, either one I'm inserting or one I'm editting, I get the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.