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.
[2]: https://s23.postimg.org/pougirxtn/2017_02_05_14h24_55.png
[3]: https://s24.postimg.org/9nk83p5tx/2017_02_05_14h46_04.png

0 answers