954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Invalid value for key 'attachdbfilename'

Hi,

I am using asp.net 2.0, SQL 2005 Express Edition.

I have created one database, thats working fine on local host.

But when I transfered files to my hosting server, Then its giving me Error:-
Invalid value for key 'attachdbfilename'.

My connection string is as follows:-

data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|DataTestingServer.mdf;Database=DataTestingServer;User Instance=true


Please Help me.

Anup

anup.maverick
Newbie Poster
16 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

you can write right click the database(mdf) file in the database(server) explorer and click properties..on the right side, you can view the properties window,Which you can get the connection string....
eg;
Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Jacob Varghese\My Documents\Visual Studio 2005\WebSites\sample\App_Data\Database.mdf;Integrated Security=True;User Instance=True
you copy all that and use

string connectionstring="Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True";
ajijacobm
Light Poster
39 posts since Aug 2009
Reputation Points: 10
Solved Threads: 1
 

if you got it correct,please mark it as solved.

ajijacobm
Light Poster
39 posts since Aug 2009
Reputation Points: 10
Solved Threads: 1
 
if you got it correct,please mark it as solved.


even i was having the same prob,,, it helped me in solving thanks bro :))))

kaar3k
Newbie Poster
5 posts since Oct 2010
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: