PC Review


Reply
Thread Tools Rate Thread

Is DataSet belong another namespace

 
 
ad
Guest
Posts: n/a
 
      18th Sep 2005
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?


 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      18th Sep 2005
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".

"ad" <(E-Mail Removed)> wrote in message
news:%235NP1L%(E-Mail Removed)...
>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?
>



 
Reply With Quote
 
ad
Guest
Posts: n/a
 
      18th Sep 2005
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.




"Peter Rilling" <(E-Mail Removed)> ¼¶¼g©ó¶l¥ó·s»D:Ohq87%23%(E-Mail Removed)...
> 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".
>
> "ad" <(E-Mail Removed)> wrote in message
> news:%235NP1L%(E-Mail Removed)...
>>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?
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Namespace of typed DataSet? Rainer Queck Microsoft C# .NET 9 18th May 2010 01:04 PM
Namespace and dataset Vik Microsoft ASP .NET 0 1st Feb 2005 05:37 PM
ADO.NET Dataset to XML and displaying namespace Simeon Lobo Microsoft ADO .NET 1 18th Jan 2005 06:15 PM
DataSet.ReadXmlSchema() changes namespace prefix David Elliott Microsoft Dot NET Framework 5 21st Jun 2004 09:33 AM
Usercontrol accessing Typed Dataset in root namespace k Microsoft Dot NET Framework Forms 0 23rd Aug 2003 10:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 AM.