Hi Massimo,
No, the idea is still the same and AFAIK it is a good solution.
You just save the rows in proper order and upon successful save you retrieve
auto generated ids.
DataRelations will take care of updating the ids in DataSet.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog:
http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group
www.codezone-si.info
"Massimo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi to all, I'm developing a test application with Visual Studio 2005 Beta
> 2 and the 2.0 framework (along as SQL Server 2005 June CTP), and I'd like
> to know if they introduce some improvements in order to solve an old
> problem: how to deal with inserting values from a DataSet into two related
> tables when one of them has an auto-generated ID column.
>
> Let's say I have these two tables in the DB, Table1 and Table2, and Table1
> has an "ID" column which is configured as an auto-generating identity;
> Table2 also has an ID column, which references Table1.ID in a foreign key
> relation.
>
> Now, I'm loading these two tables in a typed DataSet, which, being typed,
> knows the structure of the tables and the relation between them; I put a
> new row into Table1, and then another one in Table2 referencing the new
> Table1.ID.
>
> The question is: how do I put those new data into the DB, since I can't
> specify the value of the column in the master table?
>
> I know there are some workarounds for this problem (like retrieving the
> new auto-generated ID and storing it in the DataSet, or using stored
> procedures to update the tables, or using placeholder values in the
> DataSet before submitting the changes, or using GUIDS), but I'd like to
> know if ADO.NET 2.0 solves this problem in a more elegant way than 1.0 and
> 1.1 did; the new framework has so many improvements... this one would be
> quite helpful.
>
> Thanks for any answer.
>
>
> Massimo
>