Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SaveSelectCommand blows up when tableName is empty
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
SaveSelectCommand blows up when tableName is empty
Divers
Thread ID:
00973826
Message ID:
00973826
Vues:
134
Kevin,
In 1.3 beta 4, mmDataAccessSql.FillDataSet(DataSet ds, IDbDataAdapter dbAdapter,
string tableName, bool clearOnFill)

you check for an empty tableName parameter before calling adapter.fill()


if (!mmString.Empty(tableName))
{
// Fill the specified table in the DataSet
adapter.Fill(ds, tableName);
}
else
{
//Fill dataset, with table being named according to SQL rules
adapter.Fill(ds);
}


but then with

// Store the current select command for the current table in the
// DataTable's extended properties
this.SaveSelectCommand(ds, tableName, dbAdapter);

you atempt to use the empty tablename to retrieve a table reference from the dataset:

if (ds.Tables[tableName].ExtendedProperties.Contains("SelectCommand"))

which causes "Object reference not set to an instance of an object."

Thanks,
Max...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform