There was a problem loading the comments.

What Should My SQL Server Connection String Look Like?

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

 

What Should My SQL Server Connection String Look Like?

When connecting your ASP.NET application to a Microsoft SQL Server, the connection string in your web.config file must be properly formatted based on your server settings and SQL version.


Standard Connection String Format:

<connectionStrings>     
  <add name="[ConnectionStringName]" 
       connectionString="Data Source=[YourSqlServer]; Initial Catalog=[YourDatabaseName]; User ID=[YourUsername]; Password=[YourPassword]" 
       providerName="System.Data.SqlClient" />   
</connectionStrings>

🔧 What to Replace:

  • [ConnectionStringName] – Name your app expects (e.g., SiteSqlServer, CommerceTemplate)

  • [YourSqlServer] – IP address or hostname of your SQL Server

  • [YourDatabaseName] – The name of your database

  • [YourUsername] – SQL Server login username

  • [YourPassword] – Password for the SQL Server login


Compatible with SQL Server Versions:

  • SQL Server 2012

  • SQL Server 2014

  • SQL Server 2016

  • SQL Server 2017

  • SQL Server 2019

  • SQL Server 2022

All of the above versions support the same format using System.Data.SqlClient.


💡 Connection String Notes:

  • Do not include a trailing semicolon (;) at the end of the connection string. This can cause parsing issues.

  • Make sure your SQL Server IP address is correctly set in your hosting control panel (e.g., Plesk, SOLIDCP).

  • All credentials must match the ones configured when your database was created in the panel.


🎯 Common Connection String Names by Application:

Application Connection String Name
DotNetNuke SiteSqlServer
Commerce Starter Kit 2.0 CommerceTemplate, LocalSqlServer
Custom ASP.NET App Varies by developer setup

For DotNetNuke, also check the <appSettings> section for a key named SiteSqlServer.


Share via
Did you find this article useful?  

Related Articles

Tags

© Softsys Hosting