Click here to Skip to main content
15,940,173 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I have develop a web application which is executing perfectly in my local machine.
I purchase a hosting from parallel Plesk. Where I had upload all my files.
I am using AttachDBFile [.MDF]as my database, which is store in App_Data Folder.
in the server its generating error as its is not connected.
My ConnectionString

      <remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\DBASE.mdf;User Instance=true;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

if I am using the following code
      <remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\DBASE.mdf;User Instance=true;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>


Invalid value for key 'attachdbfilename'.

Please help
For security reason I am not able to disclose my IP Address, I apologized for that.

Please help me.
Updated 24-Dec-12 10:34am

1 solution

In case of local sql express, the syntax is correct, assuming that the server instance name is SQLEXPRESS, and all other parameters are correct. But are you sure, that those stand also for the provider also?
I suggest you consult with the service provider, to get the correct connection string, and consult the syntax gallery also:[^]
Share this answer
[no name] 25-Dec-12 0:09am    
not at all helpful. Please suggest other way
Sergey Alexandrovich Kryukov 25-Dec-12 0:44am    
It cannot be more useful than that. You really need to address to your provider, to get something helpful.
Sergey Alexandrovich Kryukov 25-Dec-12 0:46am    
My 5, because this is a right advice. It's interesting that this OP has 5 questions so far but 4 reports for abuse on the account. It tells something...
Zoltán Zörgő 25-Dec-12 3:28am    
Thank you.
Well, I am not a wizard... bad news for the OP :)
[no name] 27-Dec-12 10:02am    
Thanks to you only!
my only enemy .
You are not giving any answer and commenting, downrating, report abuse
What should I do.
you only close my last question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900