Subject: How to create calculated fields
Posted By: MacDevv Post Date: 8/15/2006 4:16:04 AM
Hi there

In my database i have a table person. With the following fields.
Name
surname
gender
telephone

Now i want to look up the person table from a combobox. But i can only select one of the field. How can i create a field in my dataset that joins name and surname so i can lookup the full name in my combobox. In delphi this was a calculated field but how do i do this in C#.

Reply By: MAKO Reply Date: 8/15/2006 10:31:23 AM
I've ran into the same problem, but they helped me in this forum, so I think it's time to pass the note.

- Create a table in a dataset using the xsd from VS.
- Add a new column and insert the expression "= name + surname"

with that you'll be ready to populate your combobox and set the new column as its display member.

good luck!


MAKO - "El super simio"
Reply By: MacDevv Reply Date: 8/16/2006 1:38:08 AM
Hi there MAKO thanks for your reply
column expresion:NAME+(', ')+SURNAME
Reply By: MAKO Reply Date: 8/16/2006 9:38:30 AM
Yes MacDevv, you can do just as easy as open your xsd (dataset designer) where the tables are displayed and simply add a new column at the end of your persons table named fullname, or something, and add the expression [name + sourname] in the column properties.

"Hacia la victoria siempre!"

msn = macz02@msn.com

MAKO - "El super simio"

Go to topic 48362

Return to index page 202
Return to index page 201
Return to index page 200
Return to index page 199
Return to index page 198
Return to index page 197
Return to index page 196
Return to index page 195
Return to index page 194
Return to index page 193