Convert SQL Server Database To Local Database The Best Practice!!!

Опубликовано: 19 Сентябрь 2024
на канале: The Amazing Codeverse
7k
41

how to change sql database into a local database.

Requirement to use LocalDB:
Install SQL Server Express Edition (Specially LocalDB feature)

Project Files:


Download SQL Server 2016 (All Editions):


If you are getting error:


CONNECTION STRING:
string domain = (AppDomain.CurrentDomain.BaseDirectory).ToString();

string connect = Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename= " + domain + "YourLocalDBName.mdf;" + "Integrated Security=True;Connect Timeout=15;";

Note that:
YourLocalDBName.mdf is the only thing you have to change.