General information
Category:
The Mere Mortals .NET Framework
Title:
SaveSelectCommand blows up when tableName is empty
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only