Solved

SQL Connection String

Posted on 2013-06-25
6
379 Views
Last Modified: 2013-06-25
Hi Experts I have have a MS SQL Server running on one of my home network, however i want to put an ASP.Net website on the web and connect to the database however i cant get the connection string to work and i have both ports 1433 and 1521 open and forward to the relevent machine.

my Computer Name is SQLServer-PC with Windows Authentication and would be grateful if you could give me some help.

thanks

Simon
0
Comment
Question by:SimonPrice33
6 Comments
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39275607
it is very difficult to suggest what is going over there, without actually seeing the connection string itself..

At times like this I visit the below website and validate my connection string...
http://www.connectionstrings.com/

it has connection strings for all databases and all sorts of drivers... this might be of some help..

if it does not then, please post the connection string and also the error that you are getting.
0
 

Author Comment

by:SimonPrice33
ID: 39275705
ive tried this site before but it didnt work

<add name="ExtDatabase" connectionString="Data Source=tcp:xx.xx.xx.xxx;Database=WeddingList;User Id=SQLServer-PC\Simon;Password=xxxxxx;" providerName="System.Data.SqlClient" />

the internal connection works but it doesnt need to go through my router and be port forwarded
0
 

Author Comment

by:SimonPrice33
ID: 39275765
the closest on the site that would match what im after is

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;
User ID=myUsername;Password=myPassword;

but its not getting through
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 13

Accepted Solution

by:
haloexpertsexchange earned 250 total points
ID: 39275779
The first one pretty much matches what our site is using.
  <add name="xxxxxx" connectionString="Data Source=xxxxxx;Initial Catalog=xxxxx;User ID=xxxxx;Password=xxxxx;Connection Timeout=60;Max Pool Size=500;"
   providerName="System.Data.SqlClient" />
0
 
LVL 18

Assisted Solution

by:Jerry Miller
Jerry Miller earned 250 total points
ID: 39275784
Here is one that I use that works.

<add name="ConnectionString_dev" connectionString="Data Source=serverName;Initial Catalog=DatabaseName;Persist Security Info=True;User ID=web_ID;Password=webPassword;Connection timeout=60" providerName="System.Data.SqlClient"/>

Make sure that you can connect through SQL Management using the same user name and password.
0
 

Author Closing Comment

by:SimonPrice33
ID: 39275852
Thank you guys... it was a combination of the two plus another bit that worked...

plus i went for SQL Server Authentication too

 <add name="IntDatabase" connectionString="Data Source=IPADDRESS;Initial Catalog=WeddingList;Persist Security Info=True;User ID=sa;Password=xxxxxxxx" providerName="System.Data.SqlClient" />
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question