Showing posts with label sitting. Show all posts
Showing posts with label sitting. Show all posts

Sunday, February 12, 2012

Connect to SQL through firewall?

Hi,

I have a webserver sitting on the DMZ part of the firewall and my SQL Server sitting on the LAN side. I am trying to connect to the SQL Server using SqlConnection class. All ports are correctly opened and authentication is set to mix-mode. Can I do it without using Oledbconnection?

Connection Details
ConnectionString: "data source=mysqlserver;initial catalog=Northwind;persist security info=False;user id=webuser;pwd=password;workstation id=webbill;packet size=4096"
Client Network Utilitly: Server alias "aliassqlserver" created for mysqlserver using TCP/IP, servername poiting to the IP address of mysqlserver, dynamicall determine port. "aliassqlserver" comes up in the Enterprise manager, and can be connected using "sa". "webuser" permissions have been checked with access to Northwind.

Thanks in advanced guys...

PaulWhat error are you getting? What firewall do you have? Can you ping any computer on the DMZ side from the LAN side? The best thing is to start without any firewall rules.

- Boris

Connect to sql server from asp.net web app

Hi,
I have a website on a dedicated web server that can't communicate with a sql server 2000 database sitting behind a firewall. My website is written in asp.net 2 and c# 2 and port 1433 has been opened through the firewall to allow access. On the db server is an admin database set up to use asp.net authentication. I am running Visual Web Dev 2005 Express on the web server to test the application and initially I want to connect to that db and set up my app and asp 'admin' users. For that I would normally use the 'Website/ ASP.NET Configuration' menu option within the IDE. At the moment I just get a connection error:

Server Error in '/asp.netwebadminfiles' Application.

------------------------

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.

------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Server Error in '/asp.netwebadminfiles' Application.

------------------------

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.

------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Now which server is the problem on - the web server?? What do I need to do to connect with this db? Help! Thanks in advance.

Chris

Look at the IIS logs to see what request generated the 401.2 result code.

Jeff