Click here to Skip to main content
15,895,777 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everybody,

How to create an project that load a database from itself?

For example, I have ASP .NET WEB FORMS project or MVC and I create database with SQL MANAGEMENT STUDIO and than I copy this database in app_data folder of my project.
Then I create DataGrid and I want to load data in DataGRID from app_data database,not SQL SERVER . Can I eliminate SQL SERVER?
Must I change connection string or what must I do to make a database independent fromWEB SEVER and SQl Server????
If it is not possible, how to make my project create database locally on another PC and run from there my project???

Thanks in advance.
Posted
Updated 1-Oct-15 8:03am
v3

Um...yes...in theory you can use the database directly. But...it's a very silly idea.

Web sites are intrinsically multi user, and directly accessing the file (which means treating it as a JET or ACE db) means that you lose the advantage of SQL server: multi user access. And every system I've ever worked on which accessed databases directly has had major intermittent problems when multiple users are involved. You can work round them, but it's clumsy, slow, and you have to remember to do it every single time you try to use the DB.

I would use SQL Server - the Express version will probably do - and save myself a lot of problems.
 
Share this answer
 
As already pointed out I also believe that using Sql Server would be a benefit in your application. It doesn't make any sense to create a database but not use the database management system.

On additional point of view is that if you later start load balancing the web servers you need to place the data-tier properly on a separate server. Having two completely isolated database files on separate web servers would cause a serious problem.
 
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