Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

On the LAN, I can make the SQL Server database=192.168.0.5, which is where IIS is running and the SQL Server is running

 

This doesn't work over the Internet, when I change the IP address to its remove IP. It is making a connection to the Server, but not to the SQL server (invalid database name or incorrect connection error).

 

Am I out to lunch thinking I can do this, or is there a trick to it I am missing?

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Posted


sServer = 1.2.3.4

sqlConn = New SqlClient.SqlConnection("Server=" & sServer & ";Database=" & _
           sDir & ";uid=" & sGlobSQLUser & ";pwd=" & sGlobSQLPass & ";")

       dim dt as New DataTable
       sqlDA = New SqlClient.SqlDataAdapter(sSQL, sqlConn)
       Try
           sqlDA.Fill(dt)
       Catch ex1 As Exception
           sannounce = ex1.Message
           dt.Dispose()
           sqlDA.Dispose()
           sqlConn.Close()
           sqlConn = Nothing
           Return False
           Exit Function
       End Try

 

Have also tried 1.2.3.4/ServerName

 

This isn't intranet, this is public

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Posted

I tried to create a new connection using the IP address of the remote server and SQL authentication. This failed, so I tried to use windows authentication, and this also failed.

 

It comes back the same for each: SQL server doesn't exist or incorrect login or password.

 

There is an article on MS that says that this can only be done by creating a DSN, which is what I will probably try next.

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

  • 4 weeks later...
Posted

TheWizardofInt, might or might not be the problem of network setting. Is your connection to the SQL server been set in the firewall? DMZ or NAT must be set to trasfer SQL packets to you internal SQL server.

 

I'd experienced the same error for my previous project. And NAT had solved my problem.

George C.K. Low

Posted

I was just thinking that yesterday. When you say NAT, what do you mean?

 

I was thinking that I would have to do the connection through a PORT 21 or something like that, and configure the port for two-way transfer

Read the Fovean Chronicles

Because you just can't spend your whole day programming!

Posted

If you are talking about SQL server, the port would be 1433 and 1433.

 

NAT = Network Address Translators. It depends on your firewall whether it supports NAT or DMZ. Some of the firewall support both. But for security purposes, I would suggest NAT rather than DMZ.

 

For what I had done, I just set the firewall to pass all the reeived packets with port 1433 to Internal server(192.168.0.5).

 

And ask the firewall to accept all the packets with 1434 to be sent out.

 

Kindly inform me whather this solve your problem. Hope that I could help

George C.K. Low

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...