hi i am new to c# and i am a student learning c# from last 3 month and when starting my small project i created a service based database and use to store the values in the tables. in my app i am only dealing with the tables. and queries which will be working on a single machine. i am generating a project which only will be working on a single machine. so i now realised diffrence between service based database and local database
**A service-based database is a database that is only accessed through a server. It uses an MDF data file, which is SQL Server format. To be able to connect to a SQL Server database the SQL Server service must be running, because it’s that that processes your requests and access the data file.
A local database is one that is local to your application only. It uses an SDF data file, which is SQL Server CE (Compact Edition) format. There is no need to install a server to access an SDF database**
but i formed the whole project with the service based database and used all queries which is select and update. and i used this code
connectionString = @"Data Source=.\
SQLEXPRESS;AttachDbFilename=E:\project\Database1.mdf;Integrated
Security=True;User Instance=True";
sqlConnection = new SqlConnection(connectionString);
but when shifting to .sdf file means to local database i just have to replace the new connection string? does it reflects to any of the functioning?
If the databases structures are the same, your code (potentially) has to be remain the same.
The only thing has to be changed is the connection string.
There are other type of issures that can make difference between local and server side storage like:
and so on..
But from functional (generic) point of view , your program should change only connection string.