473,385 Members | 1,615 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.

C# DataSet and AutoNumber

Kermit
16
Hi!
I have another problem. This time with AutoNumbers.

I insert a new row to a dataset (ds.Tables["Name"].Rows). How can I get it's id (which is an autonumber) without commiting changes to the database?
Sep 3 '07 #1
1 1819
Shashi Sadasivan
1,435 Expert 1GB
Hi!
I have another problem. This time with AutoNumbers.

I insert a new row to a dataset (ds.Tables["Name"].Rows). How can I get it's id (which is an autonumber) without commiting changes to the database?
You might want to query the database for the idendity....ie the largets number used so far, but dont rely on that.. might lead to concurrency issues
Sep 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Bruce Stockwell | last post by:
the setup: Webservice/WinClient application/SQL server. VS.Net (visual basic) winform wizard creates a simple form with load cancel cancelall and datagrid bound to a simple Dataset with one...
3
by: Wance | last post by:
Hi everybody, I have datatable and stored in dataset. The dataset Never connect to datasource before. How can I move mydata in dataset into the table in data souce? For instance my table say it ...
3
by: Justin | last post by:
I have created a dataset with two tables and an insert command, I need to be able to retreive the Key Identity after inserting into table "A" for use in table "B". Should I use ExecuteScalar()...
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
1
by: Brian | last post by:
Hello - Im new to ADO.NET so bear with me here. I have an Access DB, simplified as follows: TABLE Person person_ID autonumber PK last_name text first_name text
14
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
9
by: Mr Newbie | last post by:
HI People, Thanks to all who helped me earlier on the subject of @@IDentity. However, I seem to have hit another snagette! My DataSet contains two tables from the SQL Server. lets say Master...
0
by: Aziz | last post by:
I have a Customer table with a PK Autonumber (CustomerID) in my DataSet with 20 records to begin with. I can add a new record to the database using the following code: Dim drCustomer As DataRow...
3
by: Paez | last post by:
Hi there. Anybody knows if is it possible to reverse a dataset? Lets say, if the dataSet has 10 rows, row 1 will row 10 and row 10 will be 1 and so on... Thanks in advance. Paez
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: 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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.