Populating a DataGrid

stampcoverman

New member
Joined
Aug 4, 2006
Messages
2
Programming Experience
Beginner
I have successfully created an empty DataGrid on a form which shows the member titles of a web service response.

Please does anybody know the procedure for obtaining the data and populating the Datagrid.
 
Neal,
Try this is your webservice.

This will return a dataset of all the brands that are related to the Id parameter being passed in.
VB.NET:
<WebMethod()> _
    Public Function getbrandbyid(ByVal id As Integer) As DataSet
        Dim parameters As ArrayList = New ArrayList
        Dim param As SqlParameter
        param = New SqlParameter("@id", SqlDbType.Int)
        param.Value = id
        parameters.Add(param)
        Return RunSPSQLServer("csgetbrandbyid", parameters)
    End Function

Stored procedure:

Select * from brands where brands.id = @id

If you just need to retrieve items without any parameters just use teh code below.

VB.NET:
<WebMethod()> _
    Public Function getbrand() As DataSet
               Return RunSPSQLServer("csgetbrand", parameters)
    End Function

Stored Procedure:

Select * from Brands

Good Luck
 
Back
Top