G
Guest
If I run the following code on my development machine as a "Windows
Application", it works. If I run the following code on my development
machine as an "ASP.NET Web Application", I get the error "SQL Server does not
exist or access denied." when trying to open the connection. I would
appreciate any assistance in determining why.
Private Sub TestAdo()
Dim conn As New System.Data.SqlClient.SqlConnection
Dim cmd As New System.Data.SqlClient.SqlCommand
Dim dr As System.Data.SqlClient.SqlDataReader
conn.ConnectionString = "Data
Source=np:SQLSERVER1;uid=username;pwd=password;Initial
Catalog=STARMT;Connection Timeout=5;"
conn.Open()
cmd.Connection = conn
cmd.CommandText = "select * from customers"
dr = cmd.ExecuteReader()
Do While dr.Read
'
Loop
dr.Close()
conn.Close()
End Sub
Thanks in advance.
Clay
Application", it works. If I run the following code on my development
machine as an "ASP.NET Web Application", I get the error "SQL Server does not
exist or access denied." when trying to open the connection. I would
appreciate any assistance in determining why.
Private Sub TestAdo()
Dim conn As New System.Data.SqlClient.SqlConnection
Dim cmd As New System.Data.SqlClient.SqlCommand
Dim dr As System.Data.SqlClient.SqlDataReader
conn.ConnectionString = "Data
Source=np:SQLSERVER1;uid=username;pwd=password;Initial
Catalog=STARMT;Connection Timeout=5;"
conn.Open()
cmd.Connection = conn
cmd.CommandText = "select * from customers"
dr = cmd.ExecuteReader()
Do While dr.Read
'
Loop
dr.Close()
conn.Close()
End Sub
Thanks in advance.
Clay