469,573 Members | 1,143 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,573 developers. It's quick & easy.

Dummy column in datagrid

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.

Nov 22 '05 #1
2 2126
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/...ity/newsgroups
"John Latten" <John La****@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
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.

Nov 22 '05 #2
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.
"John Latten" wrote:
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.

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by John Latten | last post: by
3 posts views Thread by PeterZ | last post: by
6 posts views Thread by Robert Schuldenfrei | last post: by
6 posts views Thread by Agnes | last post: by
3 posts views Thread by TPhelps | last post: by
10 posts views Thread by Nick | last post: by
3 posts views Thread by Simon Brooke | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.