Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return DataSet From DataSet
Message
 
To
18/07/2010 12:04:08
General information
Forum:
ASP.NET
Category:
LINQ
Miscellaneous
Thread ID:
01472665
Message ID:
01472877
Views:
55
Thanks Bonnie. This worked great - with one minor change.
DataTable ResultSet = csCOSApp.ActiveProject.dsDataStore.Tables[0].Copy();

ResultSet.Rows.Clear();
csCOSApp.ActiveProject.dsDataStore.Tables[0].Select("ProductId > 0").CopyToDataTable(ResultSet, LoadOption.PreserveChanges, delegate { });
if (ResultSet.Rows.Count > 0)
{
    LoadProducts(ResultSet, true);
}

ResultSet.Rows.Clear();
csCOSApp.ActiveProject.dsDataStore.Tables[0].Select("ProductId = 0").CopyToDataTable(ResultSet, LoadOption.PreserveChanges, delegate { });
if (ResultSet.Rows.Count > 0)
{
    LoadParts(ResultSet, true);
}
I was getting "Input array is longer than the number of columns in this table.". Turns out the destination table needs to have the structure all set up. I thought CopyToDataTable would create it.

At any rate, I learned something new.

Thanks!
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform