Hi ,
I have a problem connecting to my db on a shared hosting. My host provider says they deployed SQL 2005 express on their database and I prepared my connection string as follows to take advantage of sql express.
<add name="PMIS_DBConnectionString" connectionString="Server=localhost;AttachDBFilename=|DataDirectory|PMIS_DB.mdf;Database=PMIS_DB;Trusted_Connection=Yes" />
</connectionStrings>
<system.web>\
The data source name I used originally was ./SQLExpress, but my host provider asked that I change it to local host, although with the former it didn't connect, but still with the change as indicated above the error still comes up on access to my default page. The error is as follows: Server Error in '/' Application. Invalid value for key 'attachdbfilename'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid value for key 'attachdbfilename'.
Source Error:
Line 120: Public Function GetID(ByVal sLgaName As String) As Integer Line 121: Dim q As String = "Select PLID " & "From LGA " & "Where LGAName = " & "'" & sLgaName & "'" Line 122: Dim cn As New SqlConnection(Me.ConnectionString) Line 123: Dim cmd As New SqlCommand(q, cn) Line 124:
I've read up a lot on the web and Googled my fingers numb on this. I have a deadline to deliver this project and having successfully built the app it's frustrating for this to happen. Please help me.