![]() |
|
[C#] Problem loading data from Database - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Problem loading data from Database (/showthread.php?tid=5444075) |
Problem loading data from Database - JuicyProgramming - Oct 25, 2016 Hello, I am trying to create a window where I display a list of data out of a local MSSQL database. The database is hosted locally and I have added a EDMX model to the project. When I try and load data from my database with this code: Code using (var context = new Model.Entities())It just gets stuck at that piece of code and does nothing. Data Sources are set correctly (automatically) Anyone? Thanks! * - itcorp - Oct 25, 2016 Download Example with simulation(fake table) of table: mediafire[.]com/file/4f6b52yyovlu4en/demo.zip Code namespace demoyou write well encapsulation,your code seems to have written ok although I thought it was not in my first post..sorry for that... so I made a little demo to check...What can happen to the project if it is to do in MV or project that is separate from the database leyer in anather projects must copy connection string in bouth project in some case or try to update EF from v5 to v6 over nuget and reload EF in project...If none of the above help shere app config with us. |