Advertisement

04.02.2008 at 01:35PM PDT, ID: 23290828
[x]
Attachment Details

WebService, returning string or object

Asked by Cannibal_Jack in Server Side Includes (SSI), Programming for ASP.NET, Microsoft Visual Basic.Net

Tags: VB.NET ASP.NET

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;AttachDbFilename=C:\Test\TestService\ Database.mdf;Integrated Security=True;User Instance=True"

        Dim ConnA As New Data.SqlClient.SqlConnection(Connection)
        ConnA.Open()
        Dim SQLC As String = "SELECT * FROM Personal WHERE PNum = '" & StringNum & "'"
        Dim dataAdap As New Data.SqlClient.SqlDataAdapter(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
[+][-]04.02.2008 at 02:06PM PDT, ID: 21267544

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Server Side Includes (SSI), Programming for ASP.NET, Microsoft Visual Basic.Net
Tags: VB.NET ASP.NET
Sign Up Now!
Solution Provided By: McExp
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628