Click here to Skip to main content
15,897,704 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

<connectionStrings>
      <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"/>
  </connectionStrings>


Error:
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
XML
<connectionStrings>
      <remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=123.123.123.123\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\DBASE.mdf;User Instance=true;MultipleActiveResultSets=true;" providerName="System.Data.SqlClient"/>
  </connectionStrings>


Error:

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.
Posted
Updated 24-Dec-12 10:34am
v5

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: http://www.connectionstrings.com/sql-server-2005[^]
 
Share this answer
 
Comments
[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.
—SA
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...
—SA
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