• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How connect to sql server express

P

placom

Guest
Hi, I have a windows 2003 web edition server with plesk 8.1

I can't connect from my sites to SQL server express databases.

This is conection string I'm using:

<add key="connectionString" value="Server=.\SQLEXPRESS;Trusted_Connection=true;database=mydatabase" />

that works in my old iis server without plesk

this is the error:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)



What is the correct conecction string or what can i do to be able to use sql server express in my asp.net sites with plesk 8.1

thanks
 
First of all you will probably have to set the surface area of SQL Express so it can listen on TCP/IP for SA authentication.

Your connection string needs to look something like this:

If you are migrating from SQL Express to SQL 2005 server you will need to change your connection string in the web config file to contain the following values:

<connectionStrings>
<clear />
<add name="CommerceTemplate" connectionString="Data Source=; initial catalog=database name; user ID=username; password=password;" providerName="System.Data.SqlClient" />

<add name="LocalSqlServer" connectionString="Data Source=; initial catalog=database name; user ID=username; password=password;" providerName="System.Data.SqlClient" />
</connectionStrings>

Replace the values (source, database name, username, password) with your own database values.

Make adjustments to the connection string depending upon the database name you have entered in dot net panel as well as the username and password. Your application add name may also be different from that above.
 
Well, in this try the given steps hope this will help you:
  • Launch the SQL Server Configuration Manager Click on Start > Programs > Microsoft SQL Server 2005 > Configuration Tools start menu option.
  • Select the SQL Server 2005 Network Configuration tab. There should be Protocols for SQLExpress option, and one of the protocols should be TCP IP.
  • Enable the TCP IP protocol if it is not enabled.
  • The default port for SQL Express may not be 1433. To find the port it is listening on, right-click on the TCP IP protocol and scroll all the way down to the IP All heading. There should be a section called TCP Dynamic Ports. This should list the port SQL Express is listening on. You can then put this value into the port field when adding the connection profile.
These steps are similar for both MS SQL Server Express 2005 and 2008.

Hope this will help you. But if not then might happen due to any type of corruption or error you are not able to connect to SQL server express.Then in case make use of advanced MS SQL File Repair Tool, this is best to repair any type of corruption, damages and errors in SQL server database and recover the lots objects without any hassle.
 
Back
Top