473,382 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 2299
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Latten | last post by:
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...
3
by: PeterZ | last post by:
Hi, In a running C# app with a datagrid control I select all rows in the dataGrid using CTRL-A, I then paste into some other app like notepad or Word but the column headings get left off. Is...
6
by: Robert Schuldenfrei | last post by:
Dear NG, After being away from C# programming for a spell, I am trying my hand at what should be a simple task. I have been hitting my head against the wall this morning. I have a simple order...
1
by: Drew | last post by:
Hey, thanks in advance for helping me out with my problem: I have a datagrid which is embedded in another datagrid. The datagrid is filled directly by a dataset generated from a sql query. So...
6
by: Agnes | last post by:
I understand it is impossible, but still curious to know "Can I freeze several column in the datagrid, the user can only scroll the first 3 columns (not verical), for the rest of the coulumn, it is...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
3
by: TPhelps | last post by:
I have a sample of an unbound (autogeneratecolumns is true) sortable/pagable datagrid that works. I want to change one of the columns to a hyperlink. The examples I find use a bound column. I...
10
by: Nick | last post by:
Hello, Please pardon my ignorance as I'm sure this is easy to do. I have a datagrid where I want to let the user delete columns. I added a context menu to the datagrid that has a delete option....
15
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an...
3
by: Simon Brooke | last post by:
As various people will have noticed, I've been having a lot of trouble with XSL lately. Brief history: I wrote myself an XML toolkit back in 2000, and it worked well enough for me, so it's been...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.