Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am creating a website on ASP.NET and I want to use the database file. So that on which ever system I work for that project I should easily access the databasew without creating it again and again.

Is it possible that I can have a db file through which I can access my whole database having the tables which are required in the project?
Posted

Hi,
Your question is not so clear.
Do we need to create database again and again? If you are in network just set the database connection string. And if you are not in a network then copy the mdf and database log file from that system to current location and set the path..

All the best.
--AK
 
Share this answer
 
I don't really see, what your problem could be.

If your "which ever" systems are in an intranet, you just have to have the sql server published via tcp/ip. This is default for commercial editions. If you have express edition you need to enable tcp/ip binding. You just have to use the proper connection string. If your Visual Studio Express edition has no Server explorer, only Database Explorer, you will not be able to access the server from within Visual Studio, but your application will be able to work correctly.

By the way, you don't need to recreate the database structure. Make a backup form a clean version, and you can restore on different servers, if you need.
 
Share this answer
 
Let we take it differently, why you can't use a central SQL Server database?

If geo location/connectivity is an issue, then you can use create an MDB file and copy it on all system from where you are working but I am not in favor of this because -
- You will not keep data synch between all system.
- MDB files only supports OleDB connections so you will not able to consume SQLClient.

For one time activity, if you already have database in SQLServer then you can make use of SQLServer Export wizard to convert Database into MSAccess (MDB) file.

Let's come-up with detailed question and your concerns.

Thank You
Rushikesh Joshi
 
Share this answer
 
Zoltán Zörgő5 :
The systems are not in intranet. They are on different networks.When I copy my project on other system, then I have to recreate the database and the tables which I guess is not fissible. I want a mdb file along with the project so that I can use the tables in any system whether on same network or on different. Its just for my own convinience
 
Share this answer
 
Comments
Zoltán Zörgő 14-Jun-12 5:46am    
Don't post comments as answer, since they are not answers!
Ok, I got your point. But first of all, you really use MDB (Access) files with SQL Server, not MDF files? As I said you don't have to recreate, the database. Just create once, fill up with all the data, that should be present on start. Than make a backup of it. Make a batch file that restores it to a new database on the local system (the one you are currently setting up). But you will need the SQL server to be present. If you dont need a full-blown SQL server, you can use SQL Server Compact Edition. You can deploy it easily with your application.
Read this comparison

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