access data with help of web services
From: Madalina (Madalina_at_discussions.microsoft.com)
Date: 03/16/05
- Next message: Stan: "How to debug web service from WinForm"
- Previous message: Erik Juhlin: "wse adressing"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Mar 2005 04:55:05 -0800
I made a web service in Visual Basic.Net, that accepts a parameter, title_id;
this WS will make a query in a table (from a database in a SqlServer) and get
the records with this element , and will generate 3 fields from the table.
The code look like this:
<WebMethod(Description:="Informatii despre baza de date pubs",
EnableSession:=False)> _
Public Function GetBookPrice(ByVal strTitleID As String) As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Dim DS As New DataSet
Dim strSQL As String
MyConnection.Open()
strSQL = "select title_id,title, price, notes from titles where
title_id=& strTitleID& "
MyConnection = New
SqlConnection("server=(viper);database=pubs;userid=sa;password=")
MyCommand = New SqlDataAdapter(strSQL, MyConnection)
MyCommand.Fill(DS, "BookListInfo")
Return DS
MyConnection.Close()
End Function
The problem is that I obtain an error when I try to see the results after
introducing one value from the table pubs in strTitleID and push Invoke:
http://localhost/BookDetails/BookDbList.asmx/GetBookPrice: "The page cannot
be displayed"
Please help!Thanks
Madalina
- Next message: Stan: "How to debug web service from WinForm"
- Previous message: Erik Juhlin: "wse adressing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|