Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to sql server database mdf file without installing sql server on client machine?

I am creating a window application that need to use sql server database. I want to install this application to client machine without installing sql server so that my application can still connect to a database i.e mdf file that i will be providing at client system.

How can i connect to a database(mdf) on client machine through my window application without installing sql server. ? I dont know is it possible or not.

If possible what will be the connection string in that case. Database need not be used in network.

Client mahine dont need any installation. Every thing needs to be run through pen drive

like image 889
Shantanu Gupta Avatar asked Jan 13 '10 06:01

Shantanu Gupta


People also ask

How can I open MDF file without installing SQL Server?

The only way to access MDF files without SQL server installed on your environment is to rely on a professional tool such as Kernel for SQL Recovery. It not only enables viewing of MDF files without SQL server, but also repairs corrupt, damaged, or inaccessible MDF files.

How do I import MDF files into SQL?

In the 'Object Explorer' window, right-click on the 'Databases' folder and select 'Attach...' The 'Attach Databases' window will open; inside that window click 'Add...' and then navigate to your . MDF file and click 'OK'. Click 'OK' once more to finish attaching the database and you are done.


3 Answers

.mdf files are SQL Server database files. No other application can understand, read or update those files. If you need to open and mdf, you need a SQL instance. That instance can be local, can be an Express edition, or can be a remote one, doesn't matter. If your application needs a local SQL instance for it's own use then it can install SQL Server Express Edition when deployed.

like image 69
Remus Rusanu Avatar answered Oct 08 '22 04:10

Remus Rusanu


You can try Sql Compact Edition or SqlLite. I think these are just a file based solution.

like image 26
Chris Dunaway Avatar answered Oct 08 '22 03:10

Chris Dunaway


In that case you must have a server machine where your database files are stored. For that reason you have to use SQL Express Edition 2005 or 2008 in one machine and SQL server management studio to manage your database. Those are all free from Microsoft. The client machines will be connected through the connection string. Those machines don't need SQL instance or SQL server installed.

Regards..

like image 38
CoderTuhin Avatar answered Oct 08 '22 03:10

CoderTuhin