473,769 Members | 2,348 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 1840
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
3601
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
2516
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
14949
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
3160
by: Paul Michaud | last post by:
Consider the following: Class A { .... } Class B:A { ....
22
25604
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 = ws.VerifySku(cartSet)
4
2567
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 listed below. I have two files that I want to test with the function: strFileName and strFileName2. I...
3
1986
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 from another group. There was no way for you to know it, but this is a classic asp newsgroup....
9
3803
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 that object to the web service
10
3933
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
3307
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 ExcelService : SoapHttpClientProtocol {
0
9586
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3956
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
3
2814
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.