473,573 Members | 3,961 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing a String variable to a Web Service

Hi,
Passing a string parameter to a webservice to get the dataset generated
as the result, seems to give me an error suggesting that no parameter
is being passed. However it works if I explicitly state the value as
the parameter. Code in Csharp being developed in VS2005 for ASP.NET.
Below is my webservice code.
public DataSet findAAPAssessme nt(string assessmentID)
{
//Establish a connection with the database
//Assign the type and destination of the database being queried
string source = "Provider = Microsoft.JET.O LEDB.4.0;data source
= C:\\leedsuni\\m scproject\\seco nddemo\\snomede pr.mdb;";

//Create a new connection and use the string "source" to assign
//a value to the connection
OleDbConnection o = new OleDbConnection (source);

//Open Connection
o.Open();

//Initialise string representing the query to search the
database
string query = "SELECT * FROM abdominalpainas sessmentrecords
WHERE assessment_id = " + assessmentID + "";

//Create a dataset and load assessment data into dataset

//For creating a dataset with the results of the query
OleDbDataAdapte r assessmentTable Adapter = new
OleDbDataAdapte r(query, source);
DataSet assessmentDataS et = new DataSet();
assessmentTable Adapter.Fill(as sessmentDataSet ,
"abdominalpaina ssessmentrecord s");

//Close connection
o.Close();

return assessmentDataS et;

}
My client website simply wants returned dataset. This code is below

protected void getAssessmentDa ta_Click(object sender, EventArgs e)
{

string assessmentID = assessmentIDTex tBox.Text;
DataSet assessmentDataS et =
aapassessmentda ta.findAAPAsses sment(assessmen tID);
}

I think my problem is with using a string datatype but I'm not sure.
Please help.

Thank you

Khurram

Jul 17 '06 #1
1 1827
I should also point out that the error i get is a SOAPexception error
that suggets that no parameter is being sent.

Cheers

Khurram
Deecrypt wrote:
Hi,
Passing a string parameter to a webservice to get the dataset generated
as the result, seems to give me an error suggesting that no parameter
is being passed. However it works if I explicitly state the value as
the parameter. Code in Csharp being developed in VS2005 for ASP.NET.
Below is my webservice code.
public DataSet findAAPAssessme nt(string assessmentID)
{
//Establish a connection with the database
//Assign the type and destination of the database being queried
string source = "Provider = Microsoft.JET.O LEDB.4.0;data source
= C:\\leedsuni\\m scproject\\seco nddemo\\snomede pr.mdb;";

//Create a new connection and use the string "source" to assign
//a value to the connection
OleDbConnection o = new OleDbConnection (source);

//Open Connection
o.Open();

//Initialise string representing the query to search the
database
string query = "SELECT * FROM abdominalpainas sessmentrecords
WHERE assessment_id = " + assessmentID + "";

//Create a dataset and load assessment data into dataset

//For creating a dataset with the results of the query
OleDbDataAdapte r assessmentTable Adapter = new
OleDbDataAdapte r(query, source);
DataSet assessmentDataS et = new DataSet();
assessmentTable Adapter.Fill(as sessmentDataSet ,
"abdominalpaina ssessmentrecord s");

//Close connection
o.Close();

return assessmentDataS et;

}
My client website simply wants returned dataset. This code is below

protected void getAssessmentDa ta_Click(object sender, EventArgs e)
{

string assessmentID = assessmentIDTex tBox.Text;
DataSet assessmentDataS et =
aapassessmentda ta.findAAPAsses sment(assessmen tID);
}

I think my problem is with using a string datatype but I'm not sure.
Please help.

Thank you

Khurram
Jul 17 '06 #2

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

Similar topics

4
3584
by: Amr Mostafa | last post by:
Hello :) I'm trying to write a script that deals with a web service. I'm using NuSoap class. my question is : Can I pass some variables By Reference to the web service and get the result back in my variables ?? note1: I'm not the one who wrote the web service.. so I can't modify
0
2504
by: Ted | last post by:
Would someone tell me why I am getting: "An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll. Additional information: Object variable or With block variable not set" on this line of code: lbitemSel = ws.GetImageFile(ListBox1.SelectedItem.GetType.ToString())
3
14917
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
3
3148
by: Paul Michaud | last post by:
Consider the following: Class A { .... } Class B:A { ....
22
25564
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 compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet =...
4
2553
by: thomasp | last post by:
In the code below I have a function that tests if a file exists. It takes a variable named strFileName, simple enough. My question is, is there a way to pass it a variable with another name as long as the variable is a string? In different subs the variable of the file name may have a different name. An example would be the subOpenFile...
3
1978
by: James Robertson | last post by:
I am new to the ASP and VB thing so be kind. Question I have is that I have created an ASPX web site to use as an E-Mail page. But I want to use this for a lot of users. Can I create the link on the WEB site to mail to passing a variable from the WEB site to the ASPX web site to E-Mail to? Hope I explained this correctly. This is a response...
9
3775
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting techniques are not feasible) The question is; Given that I have a Person object with a private set for id. What is the recommended approac in passing...
10
3915
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication eventname string source string ID string
7
3292
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the object is a reference type? my code is not proving that. I have a web project i created from a web service that is my object: public class...
0
7792
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7709
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8039
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8218
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5296
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3744
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1049
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.