A
AccessStarters
Can anyone please help me simply connect to northwind? Maybe some logical
steps that I may be missing?
I have tried many tutorials and they all give similar connections to the one
below.
Dim objConnection As SqlConnection = New SqlConnection("Data
Source=localhost;Integrated Security=SSPI;" & _
"Initial
Catalog=northwind")
I still cannot get a connection with sqlserver2000 (set to authentication
windows only). It is running.
TIA
Jill
Here is m entire test.aspx file (error code below too)
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script language="VB" runat="server">
Sub Page_Load()
Dim strConnection as String = "Integrated Security=SSPI;"
strConnection += "Initial Catalog=Northwind;server=localhost;"
strConnection += "Persist Security Info=no;"
strConnection += "Connect Timeout=30"
data_src.text = strConnection
Dim objConnection as New SqlConnection(strConnection)
'Now we attempt to open the connection
try
objConnection.Open()
con_open.text="Connection opened successfully.<br />"
objConnection.Close()
con_close.text="Connection closed.<br />"
catch e as Exception
con_open.text="Connection failed to open.<br />"
con_close.text=e.ToString()
end try
end Sub
</script>
<html>
<body>
<h4>Testing the data connection
<asp:label id="data_src" runat="server"/></h4>
<asp:label id="con_open" runat="server"/><br />
<asp:label id="con_close" runat="server"/><br />
</body>
</html>
---------------------------------------
error message
Testing the data connection Integrated Security=SSPI;Initial
Catalog=Northwind;server=localhost;Persist Security Info=no;Connect
Timeout=30
Connection failed to open.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at
ASP.sql_connection_aspx.Page_Load()
steps that I may be missing?
I have tried many tutorials and they all give similar connections to the one
below.
Dim objConnection As SqlConnection = New SqlConnection("Data
Source=localhost;Integrated Security=SSPI;" & _
"Initial
Catalog=northwind")
I still cannot get a connection with sqlserver2000 (set to authentication
windows only). It is running.
TIA
Jill
Here is m entire test.aspx file (error code below too)
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script language="VB" runat="server">
Sub Page_Load()
Dim strConnection as String = "Integrated Security=SSPI;"
strConnection += "Initial Catalog=Northwind;server=localhost;"
strConnection += "Persist Security Info=no;"
strConnection += "Connect Timeout=30"
data_src.text = strConnection
Dim objConnection as New SqlConnection(strConnection)
'Now we attempt to open the connection
try
objConnection.Open()
con_open.text="Connection opened successfully.<br />"
objConnection.Close()
con_close.text="Connection closed.<br />"
catch e as Exception
con_open.text="Connection failed to open.<br />"
con_close.text=e.ToString()
end try
end Sub
</script>
<html>
<body>
<h4>Testing the data connection
<asp:label id="data_src" runat="server"/></h4>
<asp:label id="con_open" runat="server"/><br />
<asp:label id="con_close" runat="server"/><br />
</body>
</html>
---------------------------------------
error message
Testing the data connection Integrated Security=SSPI;Initial
Catalog=Northwind;server=localhost;Persist Security Info=no;Connect
Timeout=30
Connection failed to open.
System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at
ASP.sql_connection_aspx.Page_Load()