Paul,
You could instantiate it as the Typed DataSet, but return a DataSet.
public DataSet GetPendingCharges()
{
ccProcessLogDataSet dsPending = new ccProcessLogDataSet ();
string sql = "SELECT * FROM " + this.TableName + " WHERE cCardType = 'PWCC'";
dsPending = this.GetDataSet(sql);
return dsPending;
}
~~Bonnie
>I have a solution file which is made up of multiple projects. One of the projects includes a typed dataset (named ccProcessLogDataSet, the table is named CCProcessLog). In a business object in this same project, I have a method that basically retrieves a dataset (via a SQL query). I'm returning a standard dataset. This code currently works.
>
>In another project in this same solution, I call this other class's method using code like this:
>
>
>Business.ccProcessLogDataSet dsPending = (Business.ccProcessLogDataSet) ccProcess.GetPendingCharges();
>
>
>The GetPendingCharges() method basically looks like this:
>
>
>public DataSet GetPendingCharges()
>{
> DataSet dsPending = new DataSet();
>
> string sql = "SELECT * FROM " + this.TableName + " WHERE cCardType = 'PWCC'";
> // Stuff deleted
> dsPending = this.GetDataSet(sql);
> // More stuff deleted
>
> return dsPending;
>}
>
>
>This compiles OK, but as soon as it reaches this line and attempts the cast, I get an invalid cast exception thrown.
>
>I'm not entirely sure why this isn't working; maybe it's staring me in the face, but I just not seeing it.
>
>Any ideas?