access data with help of web services

From: Madalina (Madalina_at_discussions.microsoft.com)
Date: 03/16/05


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



Relevant Pages

  • Re: Specifying Which database to use
    ... >How do I Specify Which database to Query before I use the Select Statement. ... Hi Henk, ... USE pubs ...
    (microsoft.public.sqlserver.programming)
  • Re: A really, really basic question
    ... If I remember correctly, the pubs database is not installed by default, you ... Try reinstalling a make sure pubs is selected. ... Did I goof up installing the MSDE? ... drive in the Microsoft SQL Server directory. ...
    (microsoft.public.data.ado)
  • Re: sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed.
    ... Master, msdb, Northwind and pubs are set to Simple recovery. ... the transaction log can not be backed up, which causwes the error you see. ... looking in database maintenance plans history i ...
    (microsoft.public.sqlserver.server)
  • Trying to get a VB.net sample working with SQL Server.
    ... I have downloaded the MSDE 2000 sample SQL Server database and the pubs ... I can view the contents of the pubs database. ... This is not surprising as there is no ASPNET user account setup for pubs. ... SQL server for usage with VB.net? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MSDE and VS -2003 and ADO.NETand downlooading database
    ... > I downloaded the pubs and northwind databases from the downloads page. ... As I said I got the pubs database ... not seen any SQL Server object, so I think the reason is VS related... ...
    (microsoft.public.sqlserver.msde)