cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

A web.config connection string for MS SQL Server and the WingtipToys demo

While attempting to deploy the Microsoft ASP Wingtip Toys demo I Googled until my fingers bled (almost! - not really, LOL) trying to figure out how to connect to the GoDaddy database for this EF code-first app.  After providing an example, almost without exception the blog post ended up saying something like "update the information for your situation", and there's the rub.  Inquiring minds want to know!  Here is the connection string that worked for me:

 

Data Source=vvv.www.xxx.yyy;Initial Catalog=NameOfYourDb;Integrated Security=False;User ID=YourDbLoginId;Password=YourPassWord;Connect Timeout=15;Encrypt=False;Packet Size=4096;

 

where:

vvv.www.xxx.yyy is the IP address of your db server, discoverable in my LittleAdmin on the Connection Info link, Connection tab.

NameOfYourDb is the actual name of the your GoDaddy SQL Server database, no backslashes, pipes, or .mdf, - just the name.

YourDbLoginId is the Username you assigned when you created your GoDaddy SQL Server database.

YourPassword is the password you entered when you created your GoDaddy SQL Server database.

 

Below are some error messages that you might have received.  They are included to help search engines find this post.

The network path was not found.
The system cannot find the file specified.

Login failed for user 'username'.

CREATE DATABASE permission denied in database 'master'.
Cannot attach the file 'somedatabasefilename.mdf' as database 'somedatabasefilename'.

Unable to complete operation. The supplied SqlConnection does not specify an initial catalog or AttachDBFileName.

A network-related or instance-specific error occurred while establishing a connection to SQL Server.

The server was not found or was not accessible.

Could not open a connection to SQL Server.

 

You can view these errors on your webpage by adding the following to your web.config:

<system.web>
    <authentication mode="None" />
    <customErrors mode="Off" />
</system.web>

 Substitute targetFramework and defaultLanguage for your development environment.

 

1 ACCEPTED SOLUTION

"CREATE DATABASE permission denied in database 'master'."
....To correct this type of errors use the connection string provided by the database managing interface provided by plesk ( mylittleadmin) and modify the connection string in web.confg file.    like this ----- <add name="ConnectionString" connectionString="Data Source=your_database_ip;Initial Catalog=your_data_base_name;Integrated Security=False;User ID=your_user_ID;Connect Timeout=15;Encrypt=False;Packet Size=4096;password=your_pass_word;Connect Timeout=30" providerName="System.Data.SqlClient" />

Try this ; it worked for me 🙂

View solution in original post

3 REPLIES 3
Helper VI

Hello @TimMackey321

Thank you for sharing your experience.

🙂

***Signature: -> Do not assume anything! If you want help, explain your problem. If my post helped you, give it a Kudo. If you have the solution, mark the topic as Solved.

I am running into the problem trying to connect to my MS SQL database.  There is no issues connecting remotely with Microsoft SQL Server on my workstation and I can also connect through PLESK panel and then myLittleAdmin.  But when I add the connection string to web.config I get a Server 500 Error.  Unable to display the resource. 

 

Here is my Web.Config,  I know the Database Name, Server IP address, User Name and password are correct as I can remote connect to the database using these credentials.    I really need to get this working quickly so any help would be awesome.  I mean really appreciated. 

 

<?xml version="1.0"?>
<configuration>

  <connectionStrings>
    <add name="ConnectionString"
     connectionString="Data Source=184.168.47.10;Integrated Security=False; Initial Catalog=DDDDDD ID=YYYYYYY; Password=XXXXXX;Connect Timeout=15;Encrypt=False;Packet Size=4096"
providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="true"/>
    <authentication mode="None" />
    <customErrors mode="Off" />
  </system.web>

</configuration>

"CREATE DATABASE permission denied in database 'master'."
....To correct this type of errors use the connection string provided by the database managing interface provided by plesk ( mylittleadmin) and modify the connection string in web.confg file.    like this ----- <add name="ConnectionString" connectionString="Data Source=your_database_ip;Initial Catalog=your_data_base_name;Integrated Security=False;User ID=your_user_ID;Connect Timeout=15;Encrypt=False;Packet Size=4096;password=your_pass_word;Connect Timeout=30" providerName="System.Data.SqlClient" />

Try this ; it worked for me 🙂

View solution in original post