Dummy column in datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

I have got a problem when adding extra (= dummy) columns to a datagrid.

I have a datagrid that is bound to a datatable. The datatable is filled with data from a SQL Server 2000 database. This data contains a column that is a foreign key to another table. In my datagrid I don't want to display this keyvalue. Instead I want to use this key to get a description out of another table.

I have added an extra column to both the datatable and the datagrid. However if I read the data from the database, I get an errormessage that says that this column does not exist in the table in the database.

What do I have to do to solve this problem? It has to be possible to edit the data and send it back to the database, except for the extra columns.
 
I'm not sure exactly how you are doing this, but it's definitely possible.
Is the problem occuring on .Fill or .Update?

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
John Latten said:
Hi there,

I have got a problem when adding extra (= dummy) columns to a datagrid.

I have a datagrid that is bound to a datatable. The datatable is filled
with data from a SQL Server 2000 database. This data contains a column that
is a foreign key to another table. In my datagrid I don't want to display
this keyvalue. Instead I want to use this key to get a description out of
another table.
I have added an extra column to both the datatable and the datagrid.
However if I read the data from the database, I get an errormessage that
says that this column does not exist in the table in the database.
What do I have to do to solve this problem? It has to be possible to edit
the data and send it back to the database, except for the extra columns.
 
I have found the problem.

I discovered that I had programmatically added an extra column to a strongly typed dataset. This is not correct. If you are using a strongly typed dataset you have to add extra columns to the xsd-file graphically. After doing that you need to generate a new dataset and build the project again.

I have done that and now verything works perfectly.
 
Back
Top