Pulling data from a database to a datagrid

cfisher440

Well-known member
Joined
Oct 11, 2005
Messages
73
Programming Experience
1-3
I'm using VS 2003

I have a datagrid that I am trying to populate with data from an Access database. I am attempting to pull in data from a query I created within Access. Here is the code at my data tier

VB.NET:
Expand Collapse Copy
Public Shared Function TestData() As DataSet
        Dim dsTestData As New DataSet
        Dim sSelect As String = "SELECT * FROM qryTest"
        Dim DBConnection As OleDbConnection = Connection()
        DBConnection.Open()
        Dim daTestData As New OleDb.OleDbDataAdapter(sSelect, DBConnection)
        daTestData.Fill(dsTestData, "qryTest")
        HttpContext.Current.Cache("dsTestData") = dsTestData
        dsTestData = HttpContext.Current.Cache("dsTestData")
        Return dsTestData
    End Function

The datagrid will show the columns, but no data in the rows.

What could I be doing wrong?
 
Must be my query:

Here is my query that works in Access:

VB.NET:
Expand Collapse Copy
Dim sSelect As String = "select sum(HSCG_GT)+sum(HSPT_GT)+sum(AM_GT)+sum(TI_GT)+sum(HT_GT)+sum(Ch_GT)+sum(Ot_GT) as Totals from tblTest where TDate Like '11*/'"

In my code, when I put that in, I recieve the columheading, but no data.

If I exclude the "where TDate Like '11*/'" part of the the query, in my code then I get numbers. So it must have something to do with the query.
 
Back
Top