inheritance

  • Thread starter Thread starter RS
  • Start date Start date
R

RS

I have a class that inherits from Dataset. I have couple of methods that
extend functionality of the dataset to fit my specific need.

I also have a SQL helper class that has method Execute dataset. Its brings
back filled dataset.

When i do :

MyDataset ds = new MyDataset();
ds = (MyDataset)SQLHelper.ExecuteDataset(some parameters); --> In runtime
this line throws an error that specified cast is invalid/

Thank you all for help!
 
RS said:
I have a class that inherits from Dataset. I have couple of methods that
extend functionality of the dataset to fit my specific need.

I also have a SQL helper class that has method Execute dataset. Its brings
back filled dataset.

When i do :

MyDataset ds = new MyDataset();
ds = (MyDataset)SQLHelper.ExecuteDataset(some parameters); --> In runtime
this line throws an error that specified cast is invalid/


Change SqlHelper to run like this

MyDataset ds = new MyDataset();
SQLHelper.FillDataset(ds,some parameters);


or

use DataSet.Merge to load your dataset from the one returned by
ExecuteDataset..

David
 
Merge works.
thank you
David Browne said:
Change SqlHelper to run like this

MyDataset ds = new MyDataset();
SQLHelper.FillDataset(ds,some parameters);


or

use DataSet.Merge to load your dataset from the one returned by
ExecuteDataset..

David
 
Back
Top