newbie needs help with a web service for infopath

D

depova

I've been trying to figure this out but can't seem to grasp it. I'm
very new to web services and am trying to create a simple one that can
receive and submit to a sql table to be used by Infopath. I have been
able to do this thanks to this microsoft article.

http://msdn.microsoft.com/library/d...y/en-us/odc_ip2003_tr/html/odc_INF_Lab_09.asp

Now I want to be able to use parameters to create query fields in
infopath so that these results can be easily filtered. This is where
I'm lost. I've tried using the SqlParameters but when I add them into
the select statement it makes the web service not work. (says it's
missing an expected parameter which was not supplied) I'm assuming I'm
missing code to be put into the webmethod but I don't know what goes
in. Any help would be greately appreciated. thanks.
 
S

S.M. Altaf [MVP]

Show us the code that you tried to use for your SQLParameters.

-Altaf




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

All that glitters has a high refractive index.
www.mendhak.com


I've been trying to figure this out but can't seem to grasp it. I'm
very new to web services and am trying to create a simple one that can
receive and submit to a sql table to be used by Infopath. I have been
able to do this thanks to this microsoft article.

http://msdn.microsoft.com/library/d...y/en-us/odc_ip2003_tr/html/odc_INF_Lab_09.asp

Now I want to be able to use parameters to create query fields in
infopath so that these results can be easily filtered. This is where
I'm lost. I've tried using the SqlParameters but when I add them into
the select statement it makes the web service not work. (says it's
missing an expected parameter which was not supplied) I'm assuming I'm
missing code to be put into the webmethod but I don't know what goes
in. Any help would be greately appreciated. thanks.
 
D

depova

I didn't really use any code besides what is in the article. (this is
all in visual studio.net) I just configured the sql data connection
and then used the query builder. Then in the criteria field for the ID
I put =@VarID. I noticed that when I did that It added it as a
parameter to the sqlparameters collection editor. Code wise It added a
"where" to the select command it automatically generated.

This is the only code I added.

[WebMethod] // A method to expose on the Web service public DataSet
ReceiveDataSet()
{
// get the data from the database and put it in the DataSet
sqlDataAdapter1.Fill(dataSet11);
// return the DataSet object with the filled data
return dataSet11;
}

I think the code to put in the receive web method is what I'm missing.
I'm just not sure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top