Click here to Skip to main content
15,901,505 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Just a simple thing I can't really seem to figure out.

I want to combine the first and the last name into a single full name field and use it for display and navigation in a combo box.

I'm not really looking to add a whole other field called full name, but if that's my only option then I can do it.

Right now, I'm only skilled in visual basic and for my current project I'm using LINQ to Entities for manipulating data. I have not and really do not plan to use stored procedures for my project at the moment.

What I have already tried, is to add a scalar property called "FullName" to my employees table in the entity data model, but I can't seem to get it to hold the first and last name fields like I've done before with regular data sets. I'm assuming it won't work this way since I'm using Entities.

Any help will be much appreciated. Thanks again for taking the time to read this.
Posted

1 solution

When you add a field to the data model it is expected to be retrieved from the database. However, since you don't have this field it won't add it to the entity.

The class created for the entity is a partial class so you can easy create another partial class in the project and add the fullname property which combines the first and last name properties.
 
Share this answer
 
Comments
Mr.McCloud 30-Mar-12 16:45pm    
Alright, thanks a lot. I'm not very familiar with partial classes, so I'll look into it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900