Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / June 2004

Tip: Looking for answers? Try searching our database.

Webservice and DataSet problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Young - 24 Jun 2004 23:20 GMT
Hi,

I have a strange problem with returning a dataset from a webservice.  Here's
some code...  The error I get at compile time is.
  "Cannot convert type 'void' to 'System.Data.DataSet'"

Can anyone help me please.  I have heard something about typed datasets,
would that make a difference?
Thanks in advance...

John Young

-------------------

Main form code...
private void button1_Click(object sender, System.EventArgs e)

{

CITWebservices.CITWS myWS = new Win_CIT.CITWebservices.CITWS();

DataSet ds = myWS.GetJobServicesList();  // ***** I GET A COMPILE ERROR HERE
*****

myWS.Dispose();

}

WebService code....

[WebMethod]

public DataSet GetJobServicesList()

{

// get a list of the job services available

DataSet ds = new DataSet();

CIT.BackendDB.DatabaseAccess dba = new CIT.BackendDB.DatabaseAccess();

ds = dba.GetJobServicesListFromDB();

return ds;

}

Data access code...

public DataSet GetJobServicesListFromDB()

{

// get the list of job services from the database and return to the
webservice

string sConnectionString = "user id=sa; Initial Catalog=CIT; Data
Source=localhost; Integrated Security=SSPI";

SqlConnection objConn = new SqlConnection(sConnectionString);

objConn.Open();

SqlDataAdapter jobServicesList = new SqlDataAdapter("SELECT Service FROM
tableLookupService", objConn);

DataSet ds = new DataSet();

jobServicesList.Fill(ds,"tableLookupService");

objConn.Close();

return ds;

}
John Young - 25 Jun 2004 00:17 GMT
Right, I finally found a solution.  It seems that it is some kind of bug.
Although it apparently happens on the beta version of VS.NET !!  I have the
full version.. Strange...

Anyway, I found the solution here >
http://support.microsoft.com/default.aspx?scid=kb;EN-US;815131

Hope that helps anyone who may have the same problem as me

John

> Hi,
>
[quoted text clipped - 72 lines]
>
> }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.