Ask a Question related to ASP.NET Web Services, Design and Development.
-
Todd #1
Newbie Question: fill a dataset with results from web service call
I am trying to get a better grasp of using web services. I have had
success when I have a user type something into a text box and then
pass that text to call an external web service on another server.
This has worked for me when the result was only a single word such as
"true" or "false". Now, I would like to make a call to a service that
returns either rows of data or more than one word, such as a stock
symbol returning the price, high, low, estimates, rating, etc. How
would I make the call to the external web service and then assign the
results to a Dataset? I want to use this dataset as the datasource
for a Data Grid to display on the screen. Or perhaps there is an
easier way to do this?
Todd Guest
-
Newbie Question - Datagrid Results
Is there a way to display the field you are GROUPING BY in a datagrid? I am doing a select count and using the GROUP BY option to display the... -
Color Fill Problem (Newbie Question)
I drew a very simple shape (a house) with the pencil tool in Illustrator CS (Windows XP). First I drew the roof of a house (with an orange fill)and... -
web service newbie dataset question
Could someone please tell me whether the following is possible? I'm especially murky about step #5 :-) I'd be very grateful for pointers to an... -
Newbie question - how to call one swf file from another at end
I see plenty of examples of how to do this on a button press, and I'm sure this is even more simple, but I'm so green I can't see it yet. I've... -
updating a typed dataset (newbie question?)
I created a DataGrid and bound a DataView of a typed DataSet to it (i tried with the DataSet as well but i'd rather use the DataView as i'm using it... -
Michael Pearson #2
Re: Newbie Question: fill a dataset with results from web service call
The "easier" way to do this is to just avoid the webservice piece and call
the database code directly.
For a webservice, it should be as simple as making your WebMethod() return a
Dataset type.
VB.Net Example
<WebMethod()> Public Function GetListOfSomething(ByVal sParamBlah As String)
As DataSet
Dim myDataSet as New DataSet()
'Insert Code here to connect to database and populate a myDataSet
Return myDataset
End Function
Michael
"Todd" <bacile99@yahoo.com> wrote in message
news:eb84a9d1.0401081429.408f03a6@posting.google.c om...> I am trying to get a better grasp of using web services. I have had
> success when I have a user type something into a text box and then
> pass that text to call an external web service on another server.
> This has worked for me when the result was only a single word such as
> "true" or "false". Now, I would like to make a call to a service that
> returns either rows of data or more than one word, such as a stock
> symbol returning the price, high, low, estimates, rating, etc. How
> would I make the call to the external web service and then assign the
> results to a Dataset? I want to use this dataset as the datasource
> for a Data Grid to display on the screen. Or perhaps there is an
> easier way to do this?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
Version: 6.0.559 / Virus Database: 351 - Release Date: 1/7/2004
Michael Pearson Guest
-
Todd #3
Re: Newbie Question: fill a dataset with results from web service call
Thanks Michael. I understand what you are talking about as I have
used the Command object several times to use a sql call or stored
procedure call to populate a Dataset and display the information in a
DataList or DataGrid. However, the purpose of calling the web service
is to access data that I can't get from my database. For example, if
I want to enter a stock symbol into a text box and press a submit
button, I can't pass that sysmbol to a table on my database because I
am not housing current data for stock prices. But there are several
external web services that will do this. I just need to know the
VB.Net syntax "from A to Z" on how I would return the web service
result set into a dataset to bind to a datagrid. I have added my Web
Reference for the stock price web service to my project, and I am
passing the symbol to the service. I just need help on how I would be
able to return the results to a DataGrid to display to the user.
I have had success using an e-mail validator with this syntax:
dim proxyEmail as new [Project
Name].refernce.path.to.external.web.service
Label.Text = proxyEmail.[webservice_name](textbox1.text)
this returns either "true" or "false" to a label that is displayed to
the user. Now if I want to return more data from a more complicated
web service and bind that to a Datagrid to display to a user how would
I do that? Do I use a Dataset control? An XMLDataDocument? Something
else? Syntax examples would be appreciated. Thanks!
"Michael Pearson" <michaelp_extrajunktoremove@televox.com> wrote in message news:<ui9V23j1DHA.2408@tk2msftngp13.phx.gbl>...> The "easier" way to do this is to just avoid the webservice piece and call
> the database code directly.
> For a webservice, it should be as simple as making your WebMethod() return a
> Dataset type.
>
> VB.Net Example
>
> <WebMethod()> Public Function GetListOfSomething(ByVal sParamBlah As String)
> As DataSet
>
> Dim myDataSet as New DataSet()
>
> 'Insert Code here to connect to database and populate a myDataSet
>
> Return myDataset
> End Function
>
> MichaelTodd Guest
-
Dino Chiesa [Microsoft] #4
Re: Newbie Question: fill a dataset with results from web service call
have you looked at the DataSet.Merge() method ?
Maybe you get ds1 from webservice1, then get ds2 from webservice2, then
merge them, then display?
-D
"Todd" <bacile99@yahoo.com> wrote in message
news:eb84a9d1.0401090504.348210a7@posting.google.c om...message news:<ui9V23j1DHA.2408@tk2msftngp13.phx.gbl>...> Thanks Michael. I understand what you are talking about as I have
> used the Command object several times to use a sql call or stored
> procedure call to populate a Dataset and display the information in a
> DataList or DataGrid. However, the purpose of calling the web service
> is to access data that I can't get from my database. For example, if
> I want to enter a stock symbol into a text box and press a submit
> button, I can't pass that sysmbol to a table on my database because I
> am not housing current data for stock prices. But there are several
> external web services that will do this. I just need to know the
> VB.Net syntax "from A to Z" on how I would return the web service
> result set into a dataset to bind to a datagrid. I have added my Web
> Reference for the stock price web service to my project, and I am
> passing the symbol to the service. I just need help on how I would be
> able to return the results to a DataGrid to display to the user.
>
> I have had success using an e-mail validator with this syntax:
> dim proxyEmail as new [Project
> Name].refernce.path.to.external.web.service
> Label.Text = proxyEmail.[webservice_name](textbox1.text)
>
> this returns either "true" or "false" to a label that is displayed to
> the user. Now if I want to return more data from a more complicated
> web service and bind that to a Datagrid to display to a user how would
> I do that? Do I use a Dataset control? An XMLDataDocument? Something
> else? Syntax examples would be appreciated. Thanks!
>
> "Michael Pearson" <michaelp_extrajunktoremove@televox.com> wrote incall> > The "easier" way to do this is to just avoid the webservice piece andreturn a> > the database code directly.
> > For a webservice, it should be as simple as making your WebMethod()String)> > Dataset type.
> >
> > VB.Net Example
> >
> > <WebMethod()> Public Function GetListOfSomething(ByVal sParamBlah As> > As DataSet
> >
> > Dim myDataSet as New DataSet()
> >
> > 'Insert Code here to connect to database and populate a myDataSet
> >
> > Return myDataset
> > End Function
> >
> > Michael
Dino Chiesa [Microsoft] Guest
-
Michael Pearson #5
Re: Newbie Question: fill a dataset with results from web service call
Oh, I see. You are getting like some Text or Array types back, and you want
to "build your own" dataset.
Take a look at this site:
[url]http://www.informit.com/isapi/product_id~%7B6A3BC7D8-47B7-4C4B-BBDF-5B20CBC985F6%7D/content/index.asp[/url]
I used that to build this small sample
Dim oDataSet As New DataSet()
Dim oTable As New DataTable()
Dim oRow As DataRow
Dim oStock(1) As Object
oTable.Columns.Add("StockSymbol", GetType(String))
oTable.Columns.Add("StockPrice", GetType(String))
oStock(0) = "BLAH"
oStock(1) = "$3.50"
oTable.Rows.Add(oStock)
oStock(0) = "BLAH2"
oStock(1) = "$6.00"
oTable.Rows.Add(oStock)
oDataSet.Tables.Add(oTable)
Michael
"Todd" <bacile99@yahoo.com> wrote in message
news:eb84a9d1.0401090504.348210a7@posting.google.c om...message news:<ui9V23j1DHA.2408@tk2msftngp13.phx.gbl>...> Thanks Michael. I understand what you are talking about as I have
> used the Command object several times to use a sql call or stored
> procedure call to populate a Dataset and display the information in a
> DataList or DataGrid. However, the purpose of calling the web service
> is to access data that I can't get from my database. For example, if
> I want to enter a stock symbol into a text box and press a submit
> button, I can't pass that sysmbol to a table on my database because I
> am not housing current data for stock prices. But there are several
> external web services that will do this. I just need to know the
> VB.Net syntax "from A to Z" on how I would return the web service
> result set into a dataset to bind to a datagrid. I have added my Web
> Reference for the stock price web service to my project, and I am
> passing the symbol to the service. I just need help on how I would be
> able to return the results to a DataGrid to display to the user.
>
> I have had success using an e-mail validator with this syntax:
> dim proxyEmail as new [Project
> Name].refernce.path.to.external.web.service
> Label.Text = proxyEmail.[webservice_name](textbox1.text)
>
> this returns either "true" or "false" to a label that is displayed to
> the user. Now if I want to return more data from a more complicated
> web service and bind that to a Datagrid to display to a user how would
> I do that? Do I use a Dataset control? An XMLDataDocument? Something
> else? Syntax examples would be appreciated. Thanks!
>
> "Michael Pearson" <michaelp_extrajunktoremove@televox.com> wrote incall> > The "easier" way to do this is to just avoid the webservice piece andreturn a> > the database code directly.
> > For a webservice, it should be as simple as making your WebMethod()String)> > Dataset type.
> >
> > VB.Net Example
> >
> > <WebMethod()> Public Function GetListOfSomething(ByVal sParamBlah As> > As DataSet
> >
> > Dim myDataSet as New DataSet()
> >
> > 'Insert Code here to connect to database and populate a myDataSet
> >
> > Return myDataset
> > End Function
> >
> > Michael
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
Version: 6.0.559 / Virus Database: 351 - Release Date: 1/7/2004
Michael Pearson Guest



Reply With Quote

