LocalDB automatic instance with specific data file using SqlConnection

Connection string

This .NET Framework Data Provider for SQL Server connection string can be used for connections to SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2014 and SQL Server 2012.

Server=(localdb)\v11.0;Integrated Security=true;
AttachDbFileName
=C:\MyFolder\MyData.mdf;