Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 24th, 2004, 10:30 AM
Registered User
Join Date: Apr 2004
Location: , , United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default .getxml problem

I am trying to retreive some data from the SQLDatabase using the following code.

<WebMethod(Description:="This gets certain information about the chemical searching via the Chemical state")> _
       Public Function getChemicalState(ByVal sChemState As String) As String

        Dim connectionString As String = "server='(local)'; user id='username'; password='password'; database='Chemical'"
        Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionStri ng)

        Dim myCommand As SqlCommand
        myCommand = New SqlCommand("usp_ChemicalState", dbConnection)
        myCommand.CommandType = CommandType.StoredProcedure

        Dim dbParam_chemicalstate As SqlParameter = New SqlParameter("@ChemState", SqlDbType.NVarChar, 6)
        dbParam_chemicalstate.Value = sChemState

        Dim myDataSet As New DataSet("GET_CHEMICAL_INFORMATION")
        Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter(myCommand)
        myDataSet.Tables(0).TableName = "CHEMICAL_INFORMATION"
        myDataSet.Tables(1).TableName = "TREATMENT_INFORMATION"

        Return myDataSet.GetXml

    End Function

When it is run and the search value is entered and you click invoke it then opens a web page and the error HTTP 500 Internal server error. Does anyone know where am going wrong.

Someday you eat the bar and sometimes the bar eats you
Reply With Quote
  #2 (permalink)  
Old May 11th, 2004, 07:15 PM
Registered User
Join Date: May 2004
Location: , , USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Can you place a break point at the beginning of your function and then run it in debug mode? Then you can step through the code and find the exact statement that errors out.

-Manish Jadhav

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

All times are GMT -4. The time now is 05:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.