2

I try to run my asp net application in godaddy webserver and get error:

Exception Details: System.ArgumentException: Invalid value for key ‘attachdbfilename’.

My connection string:

<connectionStrings>
<remove name=”LocalSqlServer”/>
<add name=”LocalSqlServer” connectionString=”Data Source=(LocalDB)v11.0;Integrated     Security=True;AttachDbFilename=|DataDirectory|Database.mdf”        providerName=”System.Data.SqlClient”/>
</connectionStrings>

Any ideas how could I fix this? I dont have this error on my pc.

user007
  • 1,064
  • 3
  • 12
  • 29
  • You do have the Database.mdf file in the App_Data folder on the server, correct? Also, are you sure GoDaddy allows attaching the database? – Brian Mains Feb 06 '13 at 13:23
  • Yes I have it in App_Data folder. Well I dont know if godaddy allows that. What could I do if it doesnt? – user007 Feb 06 '13 at 13:26
  • I think it sowsnt allow attaching databases. I neet to create database manually in control panel. – user007 Feb 06 '13 at 13:33
  • I was thinking that may be it. You can also use the generate scripts feature to generate both the schema and data as a quick copy over, if it doesn't let you upload your MDF. – Brian Mains Feb 06 '13 at 14:07
  • Better late than never, in your connection string, your Data source is missing a slash See: `Data Source=(LocalDb)\v11.0` – JD Davis Apr 10 '14 at 18:35

1 Answers1

0

Ooops, I had the same problem, in my case i did not have LocalDB installed, so how about you check for that!!

Ehsan Zargar Ershadi
  • 24,115
  • 17
  • 65
  • 95