Is DataSet belong another namespace

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?
 
P

Peter Rilling

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".
 
A

ad

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top