bebblebrox
IS-IT--Management
Hi,
I have the following webservice:
notice that the getCountry method takes a string. whenever i try to use this web service vs.net intellisense calles for an object as the parameter and if i try to use a string i get an invalid cast exception.
what gives?
thanks.
I have the following webservice:
Code:
Imports System.Web.Services
Imports System.Data.SqlClient
Imports System.Data
<System.Web.Services.WebService(Namespace:="com.catalystsolves.northwindCustomers")> _
Public Class Customers
Inherits System.Web.Services.WebService
#Region " Web Services Designer Generated Code "
Public Sub New()
MyBase.New()
'This call is required by the Web Services Designer.
InitializeComponent()
'Add your own initialization code after the InitializeComponent() call
End Sub
'Required by the Web Services Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Web Services Designer
'It can be modified using the Web Services Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: This procedure is required by the Web Services Designer
'Do not modify it using the code editor.
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
#End Region
<WebMethod()> Public Function getCustomers(ByVal country As String) As DataSet
'fill the dataset
Dim cnn As SqlConnection = New SqlConnection(cnnString)
Dim cmd As SqlCommand = cnn.CreateCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select CompanyName from customers where " & _
"country = '" & country & "'"
Dim da As SqlDataAdapter = New SqlDataAdapter
Dim ds As DataSet = New DataSet
da.SelectCommand = cmd
da.Fill(ds, "Customers")
getCustomers = ds
End Function
End Class
notice that the getCountry method takes a string. whenever i try to use this web service vs.net intellisense calles for an object as the parameter and if i try to use a string i get an invalid cast exception.
what gives?
thanks.