dataset.merge .NET 1.1  
Author Message
s26f84





PostPosted: .NET Framework Data Access and Storage, dataset.merge .NET 1.1 Top

Hey guys

Got trouble with dataset.merge in .NET 1.1 . I did 8 query with the sql database and tried to merge those tables to one dataset. it simply doesn't work. It gets 7 datatable and doesn't merge the 8th one. I wrote a simple for loop and it does the same.

mycode:

DataSet dts = new DataSet();
for (int i = 0; i < 10; i++)
{
DataTable dt = new DataTable();
dt.TableName = "table"+i;
dts.Merge(dt);
}
dataGrid1.DataSource = dts;

Result:

adds table0 till table6 and after tht doesn't add anymore tables. I display the results on a datagrid.

Please help!!! is this a bug Or constraints on DataSet.Merge




.NET Development27  
 
 
VMazur





PostPosted: .NET Framework Data Access and Storage, dataset.merge .NET 1.1 Top

Is it possible that one of the tables contains exact same data that already exists in another DataTable In this case merge will not put duplicated records

 
 
s26f84





PostPosted: .NET Framework Data Access and Storage, dataset.merge .NET 1.1 Top

data in all the tables is different for sure!!!

 
 
ahmedilyas





PostPosted: .NET Framework Data Access and Storage, dataset.merge .NET 1.1 Top

Why don't you just merge the datasets together rather than getting each datatable Or do you have to get the first few datatables and merge them

 
 
Glenn Block MSFT





PostPosted: .NET Framework Data Access and Storage, dataset.merge .NET 1.1 Top

Try putting a breakpoint and checking dts.Tables.Count to see how many actual tables got merged in.

 
 
s26f84





PostPosted: .NET Framework Data Access and Storage, dataset.merge .NET 1.1 Top

thanks guys for ur reply... i i am really p1ssed and not doing it... am now using ref Datatable as parameters :(... don't have time...

thanks again for help :)