0

I'm using the GetOleDbSchemaTable to get column info from an access db, column_name and description,
but can't figure out how to bind just the 'DESCRIPTION' and 'COLUMN_NAME' columns from the table of info returned.

below is what doesn't work, it produces grid columns for all the schematable columns, about 25 different things,

    Dim schemaTable = dbConn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, _
                      New Object() {Nothing, Nothing, "VolDataNew", Nothing})
grid1.DataSource = schemaTable
grid1.DataBind()

<ItemTemplate>
<asp:Label ID="desc" 
  text='<%# DataBinder.Eval(Container.DataItem,"DESCRIPTION") %>'
    runat="server" />
</ItemTemplate>

Edited by Reverend Jim: Fixed formatting

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by bbxrider
0

Use

DataTable dt = new DataTable();
        dt.Columns= dt.Columns.Remove("column name");

and then bind the edited table to gridview

0

please explain, you have lost me. perhaps the problem was not made clear
see attached, that is a partial pic of all the columns displayed from text='<%# DataBinder.Eval(Container.DataItem,"DESCRIPTION") %>
I want to display the column of my choosing from the table results of GetOleDbSchemaTable and only that column. since there are so many columns in the GetOleDbSchemaTable, it would be impractible to exclude them one by one

Attachments GetOleDbSchemaTable_view.png 167.73 KB
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.