connect to SQLserver Database

Discussion in 'ASP .Net Web Services' started by ton_cul, Jun 17, 2008.

  1. ton_cul

    ton_cul Guest

    I am very new to programming (2 months). I have followed an example
    (http://support.microsoft.com/kb/815672) to create a simple XML WebService.
    The example uses Visual Studio 2005. I am using VS 2008, Express SQLserver
    2005.

    After I finished creating my WebService, I tested it by right clicking on
    the .asmx file and selecting "View in Browser". In the webpage I clicked on
    the Web-Method "GetProductsData", it goes to the TEST page, and next I
    clicked the button "Invoke" which does not work (The "Invoke" button should
    show me a web page containing XML data from the Northwind Product table from
    an SQLserver database but instead I get a webpage with an error message "Web
    Site cannot display page". Then, I clicked the "Refresh the Page" button and
    got a different error message "Exception Details:
    System.InvalidOperationException: Request format is unrecognized for URL
    unexpectedly ending in '/GetProductsData'.")

    I know that the Web Service is working because when I test it by clicking
    the Web-Method "Hello World", and next the "Invoke" test button, it works
    perfectly (I get a webpage having XML containing the string "HELLO WORLD").
    Please Note that the "Hello World" Web-Method does not need to Query the
    database to return a value so the problem is not with the webservice it is
    with the connection between the webservice and the database.

    I believe that the problem is that the WebService is not able to communicate
    with the SQLserver database at runtime. At design time, I am able to
    "preview" the data from the database using the SqlDataAdapter. At runtime, I
    dont know if the DataAdapter's Fill method is actually filling the "DataSet"
    though.

    Does anyone know of a simple example using Visual Studio 2008, in C#,
    that WORKS which I can follow to make a WebService that can render data from
    a SqlServer 2005 Database???
     
    ton_cul, Jun 17, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Papa_K

    connect to sqlserver?

    Papa_K, Oct 20, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    330
    Cowboy \(Gregory A. Beamer\)
    Oct 20, 2003
  2. Replies:
    1
    Views:
    355
  3. yoshitha

    not able to connect to sqlserver

    yoshitha, Jan 5, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    435
    yoshitha
    Jan 5, 2006
  4. =?Utf-8?B?SmVmZnJleQ==?=

    Upgrading ASP w/SQLserver 2000 to ASP.NET w/ SQLserver 2005

    =?Utf-8?B?SmVmZnJleQ==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    489
    sloan
    Apr 27, 2007
  5. Replies:
    2
    Views:
    291
Loading...

Share This Page