Hi, I'm using asp.net and vb.net. I have just written my first web service and I've run into a few problems. The service itself receives a string (a personal ID number) and searches an SQL database for a match and then displays the person's information that matches the string. Here's what I have...
Dim Connection As String = "Data Source=.\SQLEXPRESS;Attach
DbFilename
=C:\Test\T
estService
\ Database.mdf;Integrated Security=True;User Instance=True"
Dim ConnA As New Data.SqlClient.SqlConnecti
on(Connect
ion)
ConnA.Open()
Dim SQLC As String = "SELECT * FROM Personal WHERE PNum = '" & StringNum & "'"
Dim dataAdap As New Data.SqlClient.SqlDataAdap
ter(SQLC, Conna)
Dim dataset As New Data.DataSet
da.Fill(ds, "Personal")
ConnA.Close()
Dim MyObject As Object
MyObject = dataset
Return MyObject
I have added the service to my site project as a reference and I have a textbox to enter the string and a button to call the service. The problem is with the web service I think, I can only return a string when I wish to return an object with results in it. When I run it and enter info in the textbox and click the button it tells me I need to pass a string not an object. Can someone give me some advice and help me solve this?
Any help would be great, thanks.
Start Free Trial