Last post Apr 30, 2010 01:29 PM by bbxrider
Apr 26, 2010 01:37 PM|bbxrider|LINK
I'm using the GetOleDbSchemaTable to get column info from an access db, column_name and description, but getting an error that the bind statement can't get the properties. I know its there because I can response.write it from its table, schemaTable.Rows(i)!DESCRIPTION.ToString
do I have to bind it differently than when binding actual data from a table using the column name for reference?
System.Web.HttpException: DataBinding: 'System.Data.Common.DataRecordInternal' does not contain a property with the name 'DESCRIPTION'.
Apr 26, 2010 04:40 PM|bbxrider|LINK
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
For i = 0 To schemaTable.Rows.Count - 1
'4 Set the datagrid's datasource to the datareader and databind
grid1.DataSource = gridTable
<asp:TemplateColumn HeaderText="DESCRIPTION" >
text='<%# DataBinder.Eval(Container.DataItem,"description") %>'
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
Apr 30, 2010 01:29 PM|bbxrider|LINK
since there is no response to this thread, I'm going to repost with a different title and hopefully better explanation to try and get results there