Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Problem with login

Hi,
Using this
	<connectionStrings>
		<add name="Mssqlconn2" connectionString="Data Source=MYSERVER2\MSSQLSERVER;Initial Catalog=proj_sch;Integrated Security=False;User ID=itelog;Password=myite00" providerName="System.Data.SqlClient"/>
	</connectionStrings>

Open in new window

in the project, and I can login the database using itelog login in SSMS, but I don't know why I get this
https://dl.dropboxusercontent.com/u/40211031/t558.png

when running the project.
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

It might be picking up the default SQLExpress connection from the machine.config. Try changing your connectionStrings section to:
<connectionStrings>
        <clear />
	<add name="Mssqlconn2" connectionString="Data Source=MYSERVER2\MSSQLSERVER;Initial Catalog=proj_sch;Integrated Security=False;User ID=itelog;Password=myite00" providerName="System.Data.SqlClient"/>
</connectionStrings>

Open in new window

Avatar of Peter Chan

ASKER

Thanks. I've put this instead

	<connectionStrings>
		<clear />
		<add name="Mssqlconn2" connectionString="Data Source=MYSERVER2\MSSQLSERVER;Initial Catalog=proj_sch;Integrated Security=False;User ID=itelog;Password=myite00" providerName="System.Data.SqlClient"/>
	</connectionStrings>

Open in new window

in Web.config, and have also stopped all services of SQLEXPRESS (by also changing its service to "Manual"), but I am still getting the same problem.
OK, so you need to start with the basics. Double check the instance name is correct and that it is listening on port 1433. When you connect from SSMS are you connecting remotely, or locally on the server itself?
Thanks. How to ensure it is listening on port 1433? I'm connecting to that locally, using SSMS.
You would need to look in SQL Server Configuration Manager to determine what port it is listening on. That should be on the start menu as part of the SQL Server installation.

Open that and look under the "SQL Server Network Configuration" section, your SQL instance should be listed under there. Firstly, make sure TCP/IP is set to Enabled. Then right-click on it, bring up the properties, and check what is listed under the Port field.

Also check if the server has a firewall, and if it does, that it is allowing inbound traffic on the port SQL Server is listening on.
Many thanks.
I see that it is listening on port 1433 and TCP/IP is set to Enabled. It seems there is no firewall on this server as I've got the message in Fig 2.
t559.png
OK. Follow the instructions here: http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

To make sure that Remote Connections are enabled.
Very sorry Carl.
As I'm using Win 2003 server, can you please give me the relevant steps, which are for Win 2003 server, to change the Firewall?
I don't have a 2003 box available to test this on, but the instructions here should be correct: http://technet.microsoft.com/en-us/library/cc778563(v=ws.10).aspx

If you are on a large corporate network there may be a hardware firewall in the way as well, but you'd need to check with your network people about that.
Thanks Carl.
Sorry Carl. I did ever do the same (to do something like Inbound/Outbound rules) against Win 2008 server (like the steps you showed in the previous url). But I do need the similar steps which can be applied to my Win 2003 server now, as currently nothing improves, after I've added the following within Win 2003 server.
t560.png
That screenshot indicates that your firewall is switched off, so it shouldn't be a problem anyway. Did you do the part about checking that Remote Connections are enabled?
Yes, I did check that Remote connection is enabled. Please see the attached. thanks
t561.png
OK. Open a command prompt on your machine and enter "ping <your_server_name>" and see if it responds. If that works enter "telnet <you_server_name> 1433" and see what happens.

Do you have SSMS on your local machine, can you connect to the remote server with that?
Many thanks. Here is what I've got

C:\Documents and Settings\Administrator>ping MYSERVER2

Pinging MYSERVER2 [127.0.0.1] with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Documents and Settings\Administrator>

Open in new window

But I get no response returned to this.

telnet MYSERVER2 1433
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial