Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 15th, 2006, 04:16 AM
Authorized User
 
Join Date: Jul 2006
Location: Schiedam, zuid holland, Netherlands.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to create calculated fields

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 With Quote
  #2 (permalink)  
Old August 15th, 2006, 10:31 AM
Authorized User
 
Join Date: Feb 2006
Location: Bluefields, , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MAKO
Default

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 With Quote
  #3 (permalink)  
Old August 16th, 2006, 01:38 AM
Authorized User
 
Join Date: Jul 2006
Location: Schiedam, zuid holland, Netherlands.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there MAKO thanks for your reply
column expresion:NAME+(', ')+SURNAME
Reply With Quote
  #4 (permalink)  
Old August 16th, 2006, 09:38 AM
Authorized User
 
Join Date: Feb 2006
Location: Bluefields, , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MAKO
Default

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"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Calculated Fields in Queries SerranoG Access 0 August 14th, 2006 10:04 AM
Help with summing calculated fields on a report dbartelt Access 6 January 4th, 2006 03:33 PM
Storing Calculated Fields dearnne Access 3 September 2nd, 2004 05:30 PM
Storing Calculated Fields dearnne Access VBA 1 August 30th, 2004 10:54 AM
Summing the Results of Two Calculated Fields CloudNine Access 1 December 24th, 2003 12:05 PM



All times are GMT -4. The time now is 11:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.