Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SaveSelectCommand blows up when tableName is empty
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
SaveSelectCommand blows up when tableName is empty
Miscellaneous
Thread ID:
00973826
Message ID:
00973826
Views:
133
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...
Next
Reply
Map
View

Click here to load this message in the networking platform