localdb examples
1 2 3 4 |
<connectionStrings> <add name ="DBConnection" connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=userstore.mdf;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False; " providerName="System.Data.SqlClient" /> </connectionStrings> |
With attachment, from ASP MVC, file will be saved in AppData dir
1 2 3 4 |
<connectionStrings> <add name="BookContext" connectionString="Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename='|DataDirectory|\Bookstore.mdf';Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings> |
ms sql server example #1
1 2 3 4 |
<connectionStrings> <add name="BookContext" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Bookstore;Integrated Security=True" providerName="System.Data.SqlClient"/> </connectionStrings> |
#2
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<connectionStrings> <add name ="DBConnection" connectionString=" Data Source=DESKTOP-T9U6IEP\SQLEXPRESS; Initial Catalog=userstore.mdf; Integrated Security=True; Connect Timeout=15; Encrypt=False; TrustServerCertificate=True; ApplicationIntent=ReadWrite; MultiSubnetFailover=False; " providerName="System.Data.SqlClient" /> </connectionStrings> |