Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 connection between sql server 2008 and c# using ip

Author  Topic 

elpop
Starting Member

5 Posts

Posted - 2011-06-28 : 10:38:01
how to connect Sql server 2008 using IP address in C#.net application??

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-06-28 : 10:39:25
http://www.connectionstrings.com/sql-server-2008


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

elpop
Starting Member

5 Posts

Posted - 2011-06-28 : 11:10:28
but this "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;" doesn't work what's the problem???
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-06-28 : 11:47:17
What's the error message?

Try these

Provider=SQLNCLI10.1;User ID=myUsername;Password=myPassword;Initial Catalog=myDataBase;Data Source=190.190.200.100;

Provider=SQLOLEDB.1;User ID=myUsername;Password=myPassword;Initial Catalog=myDataBase;Data Source=190.190.200.100;
Go to Top of Page

elpop
Starting Member

5 Posts

Posted - 2011-06-28 : 12:27:06
if connected at the same computer..the connection works:

Data Source=localhost;Initial Catalog=etat;User ID=salah;Password=test; integrated security=SSPI;

if connected at the local networks..the connection works:

Data Source=192.168.137.1,1433;Initial Catalog=etat;User ID=salah;Password=test;

the problem if connected in internet with IP address the connection is not working:

Data Source=41.99.200.11,1433;Network Library=DBMSSOCN;Initial Catalog=etat;User ID=salah;Password=test;

Why???
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-06-28 : 12:36:37
Error message?

Also, why are you specfying netlib?

The SQL Server is accross the internet? Is it a hosting company or your WAN? Are you connecting over VPN? Checked firewall settings? Is the SQL Server even exposed to the internet?
Go to Top of Page

elpop
Starting Member

5 Posts

Posted - 2011-06-28 : 13:41:01
Error message


The database in a computer connected to the internet with dynamic IP

firewall settings correct with port 1433 and use SQL server configuration Manager for active TCP/IP
Go to Top of Page

elpop
Starting Member

5 Posts

Posted - 2011-06-28 : 13:56:50
there are two problems :
1: connection failed because the connected party did not properly respond after a period of time

2: connection failed because connected host has not responded
Go to Top of Page
   

- Advertisement -