Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My requirement is that I have an existing SQL database at a remote location. I cannot access this database. I have to create a program which will be installed at this location which in turn has to be used to go through this database and get some information and store it in an excel.

My question is can I use entity framework for this? If yes, then which approach should I use, Code-first or empty model?
Posted
Updated 30-Nov-15 17:42pm
v2
Comments
BillWoodruff 1-Dec-15 0:12am    
And the constraints/requirements for the program to be installed at the remote location are ... ? All server-side code that uses Excel automation to create a spreadsheet stored on the server ?
MG1510 1-Dec-15 0:53am    
There are no constraints for a program to be installed.

Basically there is a history SQL database from which certain values have to be extracted and a report has to be prepared out of that.

1 solution

Since you have DB already created at another end, the easiest and quickest would be take the script to create BD with sample data at your end. And then use EF with database first approach.

To create a script to re-create DB with Data:
http://blog.sqlauthority.com/2012/07/18/sql-server-generate-script-for-schema-and-data-sql-in-sixty-seconds-021-video/[^]

and EF Database first approach:
http://www.entityframeworktutorial.net/database-first-with-entity-framework.aspx[^]

Thanks.
 
Share this answer
 
v2
Comments
MG1510 1-Dec-15 23:52pm    
Well I wanted to avoid running a script at the other end.

I figured out another approach.
http://www.codeproject.com/Articles/498512/Data-Accessing-Independent-From-Database-And-Entit

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