954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to save an expression datacolumn to the database?

I have a datagridview on a form with multiple columns. Three of the columns are expression columns. One column is subtracted from the second and the result is displayed in the third. Everything works great but when I hit the save button and save to the database, all the columns are saved to the database except the three columns used in the expression. They are NOT saved to the database. When I run the app in debug mode again the data in those 3 columns are gone. Is there something I am overlooking? How do you save expression data columns to the database?

oceantrain
Newbie Poster
3 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

>How do you save expression data columns to the database?

Nope. But you can create an expression column in database or create a VIEW.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Huh? create a view? I don't understand.

oceantrain
Newbie Poster
3 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

>Huh? create a view? I don't understand.

Create or Replace View TestView select No1, No2, No1 +  No2 as Expression1 from tableName
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: