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/BookDbL.../GetBookPrice: "The page cannot
be displayed"
Please help!Thanks
Madalina