Click here to Skip to main content
15,896,430 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I am new with using Entity Framework 4.0. I need
to simply read a single column from a SQL Table.

Can anyone please tell me how to do this?
Posted
Comments
Zoltán Zörgő 25-Jun-12 9:30am    
So: you have a table with several fields but you want to map only one of them? You never use the other fields in your application - why have you them? You can map all fields to the class, and use LINQ to retrieve the desired field.

Go through this. this should help you.

How to configure and use Entity Framework[^]
 
Share this answer
 
You could find this article useful. This article shows how to perform basic CRUD operations using Entity framework. You might have to use some LINQ to specify the specific column you need and you will get what you want.

An Introduction to Entity Framework for Absolute Beginners[^]
 
Share this answer
 

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