gridview .databind error

T

Trevisc

I have a datagrid that gets its data from a table who's columns are
dynamically created.

It loads perfectly the first time but I have a dropdown list that is
populated with names of months and the idea is to have them click a
month (december for example) and then the datatable gets populated
with the data specific to December and brings it back to the
gridview. When I do this I get an error on the gridview.databind line
that essentially says one of the column names that was previously here
in the grid (11-01-2007 for example) is not in the datasource.

Here is an example of what the error looks like:

dgOrders.DataSource = dt
dgOrders.DataBind() <---- ERROR HERE

A field or property with the name '11-01-2007' was not found on the
selected data source.
 
T

Trevisc

Just wanted to reiterate that i'm using a Gridview (ASP 2.0) and not a
datagrid as I mistakenly posted in the first line.
 
J

Jayakrishnan

Trevisc said:
I have a datagrid that gets its data from a table who's columns are
dynamically created.

It loads perfectly the first time but I have a dropdown list that is
populated with names of months and the idea is to have them click a
month (december for example) and then the datatable gets populated
with the data specific to December and brings it back to the
gridview. When I do this I get an error on the gridview.databind line
that essentially says one of the column names that was previously here
in the grid (11-01-2007 for example) is not in the datasource.

Here is an example of what the error looks like:

dgOrders.DataSource = dt
dgOrders.DataBind() <---- ERROR HERE

A field or property with the name '11-01-2007' was not found on the
selected data source.
Hello,
Check the Query. The error says that column not found.

Jayakrishnan V
Technology Group
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top