Invalid value for key 'attachdbfilename'.

  • Thread starter Thread starter Ross Culver
  • Start date Start date
R

Ross Culver

I got this error the first time I tried to debug a dynamic data web form. I
created the database using the VS2K5 tool in the app_data directory of the
website (specifically D:\Websites\WarrenLive\Cortana\App_Data\Cortana.mdf).

Here is value for key attachdbfilename in my connection string:
"D:\Websites\WarrenLive\Cortana\App_Data\Cortana.mdf".

I Googled this error and found a post by Gregory A. Beamer which ended with
the following suggestion: " . . . check and make sure you have the file in
the proper location."

Other than putting it in the App_Data directory, what is the 'proper
location'? Or, more to the point, what's wrong with this value?

Thanks.

Ross
 
Apparently the problem was that even though the dynamic data web form was
placed within a folder with the same name as a table in the SQLExpress
database, the form really couldn't find the database.

All I had to do to get past this error was to drag the table from the server
explorer onto the form, which of course created a gridview on the page. By
doing so, the form could now make the connection to the server.

Ross
 
Back
Top