S
steve
I keep getting the following error.
I seem to have tried everything, heres the stack trace:-
[SqlException: SQL Server does not exist or access
denied.]
System.Data.SqlClient.SqlConnection.Open() +759
ConnectionTest1.WebForm1.Page_Load(Object sender,
EventArgs e) in c:\inetpub\wwwroot\ConnectionTest1
\WebForm1.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +724
I've pinged the server and it's there!
I can connect through access, I have ASP pages running
off SQL db's on the server.
I am close to the edge
Here's the code I'm running, can anyone help me or walk
me through getting connected pleeeeze.
also any test code would be appreciated:
CODE:
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web
Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
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 strConnection As New SqlConnection
("Password=;" & _
"Persist
Security Info=True;" & _
"User ID=sa;"
& _
"Initial
Catalog=pubs;" & _
"Data
Source=myDatabase")
Dim strSql As String = "SELECT * FROM authors"
Dim objCmd As New SqlClient.SqlCommand(strSql,
strConnection)
strConnection.Open()
'objCmd.ExecuteNonQuery()
strConnection.Close()
End Sub
End Class
Thanks in advance
I seem to have tried everything, heres the stack trace:-
[SqlException: SQL Server does not exist or access
denied.]
System.Data.SqlClient.SqlConnection.Open() +759
ConnectionTest1.WebForm1.Page_Load(Object sender,
EventArgs e) in c:\inetpub\wwwroot\ConnectionTest1
\WebForm1.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +29
System.Web.UI.Page.ProcessRequestMain() +724
I've pinged the server and it's there!
I can connect through access, I have ASP pages running
off SQL db's on the server.
I am close to the edge
Here's the code I'm running, can anyone help me or walk
me through getting connected pleeeeze.
also any test code would be appreciated:
CODE:
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web
Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
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 strConnection As New SqlConnection
("Password=;" & _
"Persist
Security Info=True;" & _
"User ID=sa;"
& _
"Initial
Catalog=pubs;" & _
"Data
Source=myDatabase")
Dim strSql As String = "SELECT * FROM authors"
Dim objCmd As New SqlClient.SqlCommand(strSql,
strConnection)
strConnection.Open()
'objCmd.ExecuteNonQuery()
strConnection.Close()
End Sub
End Class
Thanks in advance