Maintaining relation between two tables when transferring records
by QmlsbA » Thu, 29 Jan 2004 08:21:04 GMT
Hi
I have two identical tables - same field names, identical datatypes(the tables are in different databases) and same
constraints
I need to transfer a record from one table to the other. While doing the transfer, the column names are to be
checked so that the right column data gets inserted into the other.
Though the column names are identical their order may be different in the tables
My thinking is having two data adapters and datasets and then do some sort of comparison of column names before I go ahead with the data insertion. Does that sound ok ?
Is there some other easy way ?
Thank
Bill
Re: Maintaining relation between two tables when transferring records
by Miha Markic [MVP C#] » Thu, 29 Jan 2004 21:54:00 GMT
Hi Bill,
Once the data is loaded you might consider using
DataTable.LoadDataRow, NewRow or ImportRow method to transfer a single row.
For merging entire DataTable you should see DataSet.Merge method.
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
tables are in different databases) and same
transfer, the column names are to be
tables.
of comparison of column names before I go ahead with the data insertion.
Does that sound ok ?