SQL Server 2005 : TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.

Hi everyone,

Please solve my problem,

When i connect remote desktop database using via SQL SERVER 2005 Management Studio,its working
But,when i connect via c# application its not working and the following error message displays:

 A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

i am used following connnetion strings :

1) Data Source=IP_ADDRESS,3640\SQLEXPRESS;Initial Catalog=DB;Persist Security Info=True;User ID=sa;Password=XXXXX

2) Server=IP_ADDRESS; Database=DB; User ID=scbeacab1003; Password=XXXXX

3) Data Source=IP_ADDRESS,3640;Network Library=DBMSSOCN;Initial Catalog=DB;User ID=sa;Password=XXXXX

I checked all Steps,

>Mixed Mode
>All services are running
>remote desktop firwall off.

developer2966Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Dhanasekaran SengodanConnect With a Mentor Commented:
add IP ADDRESS and PORTNO to MacAfee firewall execption list

To follow this link

http://service.mcafee.com/FAQDocument.aspx?lc=1033&id=TS100406
0
 
asian_niceguyCommented:
If you manually create an ODBC connection using those credentials, can you connect? If not, make sure your server name/ and or database names are correct.
0
 
developer2966Author Commented:

Servername and database name are exactly same. and i tried manually but same error.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mamalik00Commented:
Management Studio Connection which is working for you is local or remote ?

Are you connecting Management Studio from the same PC (using localhost) or Remote PC (using IP)?
0
 
developer2966Author Commented:

I found out the problem Client Mechine  enabled MacAfee firewall "on"
i turn off the MacAfee firewall its working fine.

Is it possible to work when MacAfee firewall on like "Windows execptions"?
0
 
Dhanasekaran SengodanCommented:
0
 
Pramod BugudaiCommented:
Hi. My assumptions are:

1. While installing the the option for TCP/IP is not checked. or

2. You can allow the ip address of the local machine to the Remote machine by executing a query in the remote DB.
http://support.microsoft.com/kb/287932
0
 
developer2966Author Commented:

My Problem Solved
Thanks to all.

0
 
developer2966Author Commented:
Problem Solved
0
All Courses

From novice to tech pro — start learning today.