Probably an easy web services question

Associate
Joined
18 Oct 2002
Posts
972
Location
Derby
I am experimenting with a assignment I got for Uni and I so far I am getting on pretty well with the basics of web services. This was until I tried to do the following:

1. ASP.NET web service gets some data out of an access database and binds it to a dataset

2. User loads up a aspx page and a method calls the web method which returns the dataset. The dataset is then presented to the user as a datagrid in the ASP.NET page.

For some reason the page loads fine but the datagrid does not appear. Here is the code I have done:

Web service end

Code:
<WebMethod()> _
    Public Function createDates() As DataSet
        Dim objConn As New OleDbConnection(ConfigurationSettings.AppSettings("DSN"))
        Dim objDA As OleDbDataAdapter
        Dim objDS As New DataSet()
        objDA = New OleDbDataAdapter("SELECT * FROM DATE", objConn)
        objDA.Fill(objDS, "Quantity")
        Return objDS
    End Function

ASP.NET end

Code:
Sub Page_Load()
        Dim objService As New CalcService()
        myDataGrid.DataSource = objService.createDates()
        myDataGrid.DataBind()
End Sub

I also have a bog standard datagrid at the minute:

Code:
<asp.DataGrid ID="myDataGrid" runat="Server"></asp.DataGrid>

Any help with this really appreciated. Im sure it is a simple problem.

Edit: in the datagrid declaration i have used "." instead of ":" as I get a smiley
 
Back
Top Bottom