Is DataSet belong another namespace

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use a Webservice, which retun a DataSet.
I use the code:
DataSet ds = (DataSet)wsHealth.GetSchools(Text1.Text);

But it result in an error in run time, the error message is
Unable to cast object of type 'System.Data.DataSet' to type 'DataSet'.
The namespaces I used are
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

Is there an namespace rather than System.Data which also contail DataSet?
 
You must have written some class called "DataSet" that is taking precedence.
Look at your own code and see what it contains. Maybe you could find it by
doing something like right-clicking on the DataSet name that is the return
type for GetSchools and select "Go To Definition".
 
Thanks

I can't find any user defined Calss called "DataSet" in my solution.
When I right-clicking on the DataSet name that is the return
type for GetSchools and select "Go To Definition", it bring me to the
definition of DataSet in System.Data.
 
Back
Top