Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return DataSet From DataSet
Message
 
À
18/07/2010 12:04:08
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Divers
Thread ID:
01472665
Message ID:
01472877
Vues:
56
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform