Database -- What am i not understanding.
-
I have an ms access db with many 'views' (queries) within the database that I want to use with ADO.NET but it seems I'm having to reinvent the wheel to use them the way i want. Simplified example: Lets say i have a query within Access "Select FirstName, LastName, FirstName + ' ' + LastName as FullName FROM Customers" Now I use that in a DataTable bound to a DataGrid -- When i enter (or edit) the FirstName and LastName and move to the next row it doesn't update the 'calculated field' FullName. I know I can make a 'Calculated Column' and make it work but im trying not to have to write so much dang code and use what already works. Am I just missing somthing obvious? Is there a way to tell ADO that the field should calculate 'LIVE' using the sql, or do I have to insert into code every calculation done with the data as a calculated column?
-
I have an ms access db with many 'views' (queries) within the database that I want to use with ADO.NET but it seems I'm having to reinvent the wheel to use them the way i want. Simplified example: Lets say i have a query within Access "Select FirstName, LastName, FirstName + ' ' + LastName as FullName FROM Customers" Now I use that in a DataTable bound to a DataGrid -- When i enter (or edit) the FirstName and LastName and move to the next row it doesn't update the 'calculated field' FullName. I know I can make a 'Calculated Column' and make it work but im trying not to have to write so much dang code and use what already works. Am I just missing somthing obvious? Is there a way to tell ADO that the field should calculate 'LIVE' using the sql, or do I have to insert into code every calculation done with the data as a calculated column?
OICU812 wrote: When i enter (or edit) the FirstName and LastName and move to the next row it doesn't update the 'calculated field' FullName. That's because it's not a calculated column. It's a 3rd column, called FullName, in a table returned by the Jet Engine, which did the "calculation." In order to see the changes with the code you've written, you'll have to write the FirstName and LastName fields back to the database and then refresh the dataset, thereby returning a new FullName column. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
OICU812 wrote: When i enter (or edit) the FirstName and LastName and move to the next row it doesn't update the 'calculated field' FullName. That's because it's not a calculated column. It's a 3rd column, called FullName, in a table returned by the Jet Engine, which did the "calculation." In order to see the changes with the code you've written, you'll have to write the FirstName and LastName fields back to the database and then refresh the dataset, thereby returning a new FullName column. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome