473,329 Members | 1,238 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,329 software developers and data experts.

Webservice and DataSet problem.

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;

}
Nov 21 '05 #1
1 2886
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...b;EN-US;815131

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

John
"John Young" <polomint77ATAThotmail.com> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
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;

}

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
2
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
8
by: Programatix | last post by:
Hi, I'm working on a project which includes XML WebServices and Windows Form application. The Windows Form application will call the XML WebServices to retrieve data from database. The data...
1
by: Andy | last post by:
Hello, I have a WebService that sends a client a DataSet as XML (I use a DataSet.GetXml to get the XML). The DataSet is filled by a DataAdapter in the WebService. The client coverts the XML Back...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
0
by: Rob C | last post by:
I have several methods implemented in a webservice written in C#. The methods execute SQL against a SQL Server 2005 db and returns a Dataset (as XML). I am utilizing the webservice from a VC++...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.