I am trying to connect to sql express which is integrated with Visual Studio Community Edition (2013).
this is my code and connect string.
Dim mycn As New Odbc.OdbcConnection
Dim strcn As String = "Data Source=(localdb)\v11.0;AttachDBFilename=|DataDirectory|\sqlserver.mdf;Integrated Security=True;Connect Timeout=30"
mycn.ConnectionString = strcn
mycn.open
my mdf file is sqlserver.mdf. I have also tried replacing |dataDirectory| with the path to the mdf file. I keep getting a "data source not found error when I try to open the connection. Can anyone help?
this is my code and connect string.
Dim mycn As New Odbc.OdbcConnection
Dim strcn As String = "Data Source=(localdb)\v11.0;AttachDBFilename=|DataDirectory|\sqlserver.mdf;Integrated Security=True;Connect Timeout=30"
mycn.ConnectionString = strcn
mycn.open
my mdf file is sqlserver.mdf. I have also tried replacing |dataDirectory| with the path to the mdf file. I keep getting a "data source not found error when I try to open the connection. Can anyone help?