Connect Database Sql Server 2014 using Visual Studio 2015

Using C #, connect to a database created with SQL Server 2014 Management Studio using Visual Studio 2015.

SQL Server 2014 Management Studio

![Database: "DatabaseProva"][2]

I am interested to know which string to use to be able to connect from Visual Studio 2015 to "DatabaseProva"

Until now I am connected to the database created with Visual Studio 2015. So I used the following string

SqlConnection con = new SqlConnection (@ "Data Source = (LocalDB) \ MSSQLLocalDB; AttachDbFilename = C: \ Users \ myname \ Desktop \ CODE \ Visual Studio \ Project \ ES10 \ Database2.mdf; Integrated Security = True");

In the case of database created by SQL Server 2014 instead, the path is different. And this:
![Path DatabaseProva][3]

So, how do I connect to this "DatabaseProva"? Which string should I use? What should I write?

Thanks to anyone who wants to help me.

0 answers