Accessing DataTable Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Folks,
I am having a problem reading an existing typed datatable. I am sure that I
have over looked something simple but I am not seeing the forest for the
trees. I am using the below code and the reader does not pickup any rows.

Private MyDataSet As SomeDataSet
Private MyDataTable As SomeDataSet.SomeDataTable

'The WhereClause is just date range SomeColumnDateValue >= #9/9/1999# AND
SomeColumnDateValue <= #9/10/1999#
Private Function MyGetData(ByVal MyWhereClaus As String) As ArrayList

'Configure and execute datareader
Dim MyDataTable As New DataTable

MyDataSet = New SomeDataSet
MyDataTable = New SomeDataSet.SomeDataTable

Dim MyArrayList As New ArrayList
'Dim MyDataTable As New DataTable

'I have tried both the table linkages
MyDataTable = New SomeDataSet.SomeDataTable
'or
MyDataTable = MyDataSet.Tables("DataTableName")

Dim MyExpression As String = MyWhereClaus
Dim MySortOrder As String = Me.OptionSelection & " DESC"
'The OptionSelection is SomeColumnName

MyDataTable.Select(MyExpression, MySortOrder)
Dim MyDataTableReader As New DataTableReader(MyDataTable)

I get a null result (0 rows) with the correct schema, it does not matter
wether
I use the filter assignment or not.

Any help is appreciated
 
Sorry, I don't see where the New DataSet or DataTable are populated with
rows. A ST DataTable is simply a structure to map the rowset data.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
Back
Top