J
Jeff
Hi -
I have an ASP.NET web page accessing a SQL database. It works fine on the
web, and I'm trying to get it to also work in debug mode in the IDE. The
"on the web" page and my SQL database are hosted by a third party (on
separate servers).
Since debug mode opens IE and loads my page from localhost, since the
database is located at a web URL, and since my development machine has an
always-on DSL connection, I'm hoping there's a way to get this to work.
While I've provided (below) my entire page load event code, the connection
string that works when I upload the page to the third-party host is:
Network Library=dbmssocn;Password=myPassword;User ID=myUser;Initial
Catalog=myDB;Data Source=000.000.000.000;
[values are changed for reasons of security.]
When I try to run the page on my development machine in debug mode, IE
opens, the status bar reports that it is opening my localhost page, and IE
hangs. (Eventually I get a page cannot be displayed error.) Again, this
same page works fine when uploaded.
I've also tried adding a ",1433" at the end of the Data Source URL as
suggested by connectionstrings.com. Same result.
How can I get this to work??
Thanks for your help.
- Jeff
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim conMain As SqlConnection
Dim sqlCmd As SqlCommand
Dim strConn As String
Try
strConn = ""
strConn = strConn & "Network Library=dbmssocn;"
strConn = strConn & "Password=myPassword;"
strConn = strConn & "User ID=myUser;"
strConn = strConn & "Initial Catalog=myDB;"
strConn = strConn & "Data Source=000.000.000.000;"
conMain = New SqlConnection(strConn)
sqlCmd = New SqlCommand("SELECT FirstName, LastName FROM Customers",
conMain)
conMain.Open()
Dim rdrCustomers As SqlDataReader = sqlCmd.ExecuteReader
dgCustomers.DataSource = rdrCustomers
dgCustomers.DataBind()
conMain.Close()
Catch ex As Exception
Response.Write(ex.ToString)
End Try
End Sub
I have an ASP.NET web page accessing a SQL database. It works fine on the
web, and I'm trying to get it to also work in debug mode in the IDE. The
"on the web" page and my SQL database are hosted by a third party (on
separate servers).
Since debug mode opens IE and loads my page from localhost, since the
database is located at a web URL, and since my development machine has an
always-on DSL connection, I'm hoping there's a way to get this to work.
While I've provided (below) my entire page load event code, the connection
string that works when I upload the page to the third-party host is:
Network Library=dbmssocn;Password=myPassword;User ID=myUser;Initial
Catalog=myDB;Data Source=000.000.000.000;
[values are changed for reasons of security.]
When I try to run the page on my development machine in debug mode, IE
opens, the status bar reports that it is opening my localhost page, and IE
hangs. (Eventually I get a page cannot be displayed error.) Again, this
same page works fine when uploaded.
I've also tried adding a ",1433" at the end of the Data Source URL as
suggested by connectionstrings.com. Same result.
How can I get this to work??
Thanks for your help.
- Jeff
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim conMain As SqlConnection
Dim sqlCmd As SqlCommand
Dim strConn As String
Try
strConn = ""
strConn = strConn & "Network Library=dbmssocn;"
strConn = strConn & "Password=myPassword;"
strConn = strConn & "User ID=myUser;"
strConn = strConn & "Initial Catalog=myDB;"
strConn = strConn & "Data Source=000.000.000.000;"
conMain = New SqlConnection(strConn)
sqlCmd = New SqlCommand("SELECT FirstName, LastName FROM Customers",
conMain)
conMain.Open()
Dim rdrCustomers As SqlDataReader = sqlCmd.ExecuteReader
dgCustomers.DataSource = rdrCustomers
dgCustomers.DataBind()
conMain.Close()
Catch ex As Exception
Response.Write(ex.ToString)
End Try
End Sub