Ctype Datasource to DataTable .. always empty?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jobs

    #1

    Ctype Datasource to DataTable .. always empty?

    The below always results in an empty table, when I know the Gridview
    has rows.

    Dim dataTable As DataTable = CType(ChargeGri dView.DataSourc e,
    DataTable)
    If Not (dataTable Is Nothing) Then '****** (THIS IS ALWAYS
    FALSE) ****

    Is there a correct way to do this?

  • geno1

    #2
    Re: Ctype Datasource to DataTable .. always empty?

    I think you should try to display the dataTable of the dataSet that you
    originally set the ChargeGridView. DataSource to

    say

    Dim ds as DataSet
    'Fill ds with data
    ChargeGridView. DataSource = ds

    'now you can access the data in the ds
    Dim dataTable As DataTable = ds.tables(0)


    On Oct 23, 12:43 pm, "jobs" <j...@webdos.co mwrote:
    The below always results in an empty table, when I know the Gridview
    has rows.
    >
    Dim dataTable As DataTable = CType(ChargeGri dView.DataSourc e,
    DataTable)
    If Not (dataTable Is Nothing) Then '****** (THIS IS ALWAYS
    FALSE) ****
    >
    Is there a correct way to do this?

    Comment

    Working...