Hi all,
i am creating an application in VS 2010 (VB) that uses a local Compact SQL (.sdf) database.
I have configured my connection as per below and it works perfectly in the F5/Run command of teh VS 2010 environment.
When I publish the application, it returns that teh database could not be found...
I have put a "build action" for the database file as: "Content"
How do I change my connection string to reflect the correct path of the database file?
I added it in my Resources tab as a file in my project's properties but then the code refuses a change to:
because "the operator & is not defined for string and 1-dimensial-binary"
i am creating an application in VS 2010 (VB) that uses a local Compact SQL (.sdf) database.
I have configured my connection as per below and it works perfectly in the F5/Run command of teh VS 2010 environment.
Code:
Dim strConn As String = "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5; Data Source = MyDatabase.sdf"
I have put a "build action" for the database file as: "Content"
How do I change my connection string to reflect the correct path of the database file?
I added it in my Resources tab as a file in my project's properties but then the code refuses a change to:
Code:
Dim strConn As String = "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5; Data Source = " & My.Resources.MyDatabase & """"