Retreive Data from WS

M

Morx

My web service retreives data from a NorthWind database.

THIS works with Windows form but the same code wont work in ASP.NET project.
WHY?

My web service
----------------
<WebMethod()> Public Function GetCustOrders(ByVal IDMask As String) As
DataSet

IDMask = IDMask.Replace("'", "''")
Dim con As New
SqlConnection("server=MARKUS;database=Northwind;trusted_connection=true")
Dim daCust As New SqlDataAdapter("Select * From Customers Where CustomerID
Like '%" & IDMask & "%'", con)
Dim ds As New DataSet
con.Open()
daCust.Fill(ds, "Cust")
con.Close()
Return ds
End Function

Consume code for my application -!!! Why this works for Windows forms but
not for ASP.NET !!!
----------------------------------------------------------------------------
-----------------------------------------------

Dim MyService As New localhost.Service1
MyService.Credentials = System.Net.CredentialCache.DefaultCredentials
DataGrid1.DataSource = MyService.GetCustOrders(TextBox1.Text)
DataGrid1.DataMember = "Cust"
End Sub


Controls on ASP.NET form are textbox, button and datagrid.



Thank you all
 
M

Morx

Morx said:
My web service retreives data from a NorthWind database.

THIS works with Windows form but the same code wont work in ASP.NET project.
WHY?

My web service
----------------
....

My solution: DataGrid1.DataBind()



:)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,416
Messages
2,571,562
Members
48,797
Latest member
shadowoftheunknown

Latest Threads

Top