J
Jon S via DotNetMonster.com
Hi all,
I'm trying to update the target database with the data thats in the target
dataset. I've included the snippit of code that is populating the target
dataset. When I loop round I see the source dataset give data to the target
dataset. I just don't know how to update the target database with the target
dataset.
Any help will be much appreciated???
Thanks, Dan.
if( tbl_Target.Rows.Count > -1 )
{
foreach(DataColumn col_Source in tbl_Source.Columns) //Create column object
to go through each column in table (source).
{
DataRow row_Target = tbl_Target.Rows[0]; //Create row object to state which
row to work on.
string str_ColNameSource; //Variable to hold the name of each column.
row_Target.BeginEdit();
str_ColNameSource = col_Source.ColumnName;
row_Target[str_ColNameSource] = row_Source[str_ColNameSource];
row_Target.EndEdit();
da_Target.Update(ds_Target, "Layouts");
}
}
I'm trying to update the target database with the data thats in the target
dataset. I've included the snippit of code that is populating the target
dataset. When I loop round I see the source dataset give data to the target
dataset. I just don't know how to update the target database with the target
dataset.
Any help will be much appreciated???
Thanks, Dan.
if( tbl_Target.Rows.Count > -1 )
{
foreach(DataColumn col_Source in tbl_Source.Columns) //Create column object
to go through each column in table (source).
{
DataRow row_Target = tbl_Target.Rows[0]; //Create row object to state which
row to work on.
string str_ColNameSource; //Variable to hold the name of each column.
row_Target.BeginEdit();
str_ColNameSource = col_Source.ColumnName;
row_Target[str_ColNameSource] = row_Source[str_ColNameSource];
row_Target.EndEdit();
da_Target.Update(ds_Target, "Layouts");
}
}