Click here to Skip to main content
15,891,473 members
Home / Discussions / C#
   

C#

 
AnswerRe: re-cast of Control back to its Native Type ? Pin
Pete O'Hanlon13-Oct-15 1:14
mvePete O'Hanlon13-Oct-15 1:14 
GeneralRe: re-cast of Control back to its Native Type ? Pin
BillWoodruff13-Oct-15 2:06
professionalBillWoodruff13-Oct-15 2:06 
GeneralRe: re-cast of Control back to its Native Type ? Pin
Pete O'Hanlon13-Oct-15 2:21
mvePete O'Hanlon13-Oct-15 2:21 
GeneralRe: re-cast of Control back to its Native Type ? Pin
BillWoodruff13-Oct-15 3:01
professionalBillWoodruff13-Oct-15 3:01 
AnswerRe: re-cast of Control back to its Native Type ? Pin
Eddy Vluggen13-Oct-15 1:42
professionalEddy Vluggen13-Oct-15 1:42 
GeneralRe: re-cast of Control back to its Native Type ? Pin
BillWoodruff13-Oct-15 2:18
professionalBillWoodruff13-Oct-15 2:18 
GeneralRe: re-cast of Control back to its Native Type ? Pin
Eddy Vluggen13-Oct-15 3:41
professionalEddy Vluggen13-Oct-15 3:41 
QuestionGet rows from database, Entity framework Pin
Member 1204569212-Oct-15 1:49
Member 1204569212-Oct-15 1:49 
I have created a .mdf database file. I have created a table and populated It with rows.

Im trying to use Entity framework, to comunicate with the database.

Here, Im using a context to connect to the database:

C#
namespace SportsStore.domain.Concrete
{
    //Associate the model with the database
    //This class then automatically defines a property for each table in the database that I want to work with.
    public class EFDbContext : DbContext
    {
        public DbSet<Product> Products { get; set; }
    }
}


And here, Im trying to get the rows from the database:

C#
namespace SportsStore.domain.Concrete
{
    public class EFProductRepository : IProductRepository
    {
        private EFDbContext context = new EFDbContext();

        public IEnumerable<Product> Products
        {
            get { return context.Products; }
        }
    }
}


When I run my application, nothing Is printed out. The rows from the database are not printed out.

Anyone who can help me with this? Should I add something to Web.Config? If so, what should I add?
AnswerRe: Get rows from database, Entity framework Pin
Dave Kreskowiak12-Oct-15 4:36
mveDave Kreskowiak12-Oct-15 4:36 
GeneralRe: Get rows from database, Entity framework Pin
Member 1204569212-Oct-15 4:48
Member 1204569212-Oct-15 4:48 
GeneralRe: Get rows from database, Entity framework Pin
Dave Kreskowiak12-Oct-15 4:50
mveDave Kreskowiak12-Oct-15 4:50 
GeneralRe: Get rows from database, Entity framework Pin
Member 1204569212-Oct-15 5:09
Member 1204569212-Oct-15 5:09 
GeneralRe: Get rows from database, Entity framework Pin
Dave Kreskowiak12-Oct-15 5:14
mveDave Kreskowiak12-Oct-15 5:14 
GeneralRe: Get rows from database, Entity framework Pin
Member 1204569212-Oct-15 9:35
Member 1204569212-Oct-15 9:35 
GeneralRe: Get rows from database, Entity framework Pin
Dave Kreskowiak12-Oct-15 9:54
mveDave Kreskowiak12-Oct-15 9:54 
GeneralRe: Get rows from database, Entity framework Pin
Member 1204569212-Oct-15 10:30
Member 1204569212-Oct-15 10:30 
GeneralRe: Get rows from database, Entity framework Pin
Dave Kreskowiak12-Oct-15 10:33
mveDave Kreskowiak12-Oct-15 10:33 
Questionhow to read data from gps (TK103) in .net Pin
Member 454542811-Oct-15 6:34
professionalMember 454542811-Oct-15 6:34 
AnswerRe: how to read data from gps (TK103) in .net Pin
Dave Kreskowiak11-Oct-15 11:09
mveDave Kreskowiak11-Oct-15 11:09 
AnswerRe: how to read data from gps (TK103) in .net Pin
ZurdoDev13-Oct-15 2:59
professionalZurdoDev13-Oct-15 2:59 
Questionwant to add xlsm file in project and automatic copy the data of xlsm file in other side Pin
Member 1204967211-Oct-15 1:20
Member 1204967211-Oct-15 1:20 
AnswerRe: want to add xlsm file in project and automatic copy the data of xlsm file in other side Pin
OriginalGriff11-Oct-15 1:53
mveOriginalGriff11-Oct-15 1:53 
SuggestionRe: want to add xlsm file in project and automatic copy the data of xlsm file in other side Pin
Kornfeld Eliyahu Peter11-Oct-15 2:44
professionalKornfeld Eliyahu Peter11-Oct-15 2:44 
General2 texbox value transfar ti cobobox Pin
Member 1204736710-Oct-15 17:21
Member 1204736710-Oct-15 17:21 
QuestionIs this a secure way to encrypt? Pin
Jassim Rahma10-Oct-15 11:27
Jassim Rahma10-Oct-15 11:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.