I have a strange problem. I'm trying to connect to a Microsoft SQL server from C# (.Net 4.0). The server is running MSDE2000(8.00.194). When I connect I get the following message:
System.Data.SqlClient.SqlException (0x80131904): 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.)
My connectionstring looks like this,(yes i'm using a blank password): "User Id=sa;Password=;Data Source=192.168.0.100\?,1433;Trusted_Connection=false;Initial Catalog=DATABASE1;"
I've tried changing pretty much everything in the connection string to get it to work without success. I've even tried doing an OleDBConnection instead of the SqlConnection but without success.
The strange thing is that when I connect through Microsoft Management Studio I'm able to connect and see everything. But I get disconnected between every command I send and have to reconnect.
Does anyone know what the problem might be or where I should start looking to find the problem?
Edit: I might add that I tried to telnet to the machine on port 1433 but got "Connection closed by host". The thing is that I do not have access to the computer so I can't check firewall settings but isn't the Management Studio connecting the same way as .Net do?