User-146799434 posted
perhaps making progress, but new problem. I built a 2 column data table for the datagrid source, using the info returned from GetOleDbSchemaTable. but the page displays 3 columns instead of 1 that I specified in the datagrid?????????
Dim gridTable As New DataTable
gridTable.Columns.Add("column_name")
gridTable.Columns.Add("description")
For i = 0 To schemaTable.Rows.Count - 1
gridTable.Rows.Add(schemaTable.Rows(i)!COLUMN_NAME.ToString, schemaTable.Rows(i)!DESCRIPTION.ToString)
Next i
'4 Set the datagrid's datasource to the datareader and databind
grid1.DataSource = gridTable
grid1.DataBind()
<asp:TemplateColumn HeaderText="DESCRIPTION" >
<ItemTemplate>
<asp:Label ID="desc"
text='<%# DataBinder.Eval(Container.DataItem,"description") %>'
runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
what i get on the page is about like this - note column headers are in the same case as on page, so I'm getting both columns from the table I created plus an extra 3rd column!!! that is not even in the datagrid source table!!!
DESCRIPTION column_name
description
desc 1 from table col name 1
desc 1 from table (same as first column)
next etc next etc
next