What is the connection string to MSSQLLocalDB ?

  • Thread starter Thread starter Valkyrie.7
  • Start date Start date
V

Valkyrie.7

Guest
I am using VS 2019 community, wpf c# app and I created a database and table in the SQL Server Object explorer. Now I want to connect and query this table so what is the connection string I should use ?






SqlDataReader rdr = null;
SqlConnection con = null;
SqlCommand cmd = null;

string ConnectionString = "Data Source=(localdb)\MSSQLLocalDB;server=localhost;database=New Database";
con = new SqlConnection(ConnectionString);
con.Open();



1517606.jpg

Continue reading...
 
Back
Top