Data link properties
Server name: FILCAN
Enter information to log on to the server:Use [u]W</u>indows NT Integrated security
Attach a database file as a database name:
Using the filename:C:\Program Files\Microsoft SQL Server\MSSQL\Data\Northwind.mdf
Test connection succeeded
and I got this error message.
SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +472
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +311
System.Data.SqlClient.SqlConnection.Open() +383
ASP.SQLServer_connection_aspx.Page_Load(Object Source, EventArgs E) +72
System.Web.UI.Control.OnLoad(EventArgs e) +55
System.Web.UI.Control.LoadRecursive() +27
System.Web.UI.Page.ProcessRequestMain() +731
And I have these code
%@ Page Language="
vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "server=(local)\netSDK database=Nortwind; " & _
"integrated security=true;"
Dim objConnection As New SqlConnection(strConnection)
Dim strSQL As String ="SELECT Firstname, LastName, Country " & _
"FROM Employees"
Dim objCommand As New SqlCommand (strSQL, objConnection)
objConnection.Open()
dgNameList.DataSource = objCommand.ExecuteReader()
dgNameList.Databind()
objConnection.Close()
End sub
</script>
<html>
<head>
<title>Beginning ASP.NET Databases Chapter 3</title>
</head>
<body>
<h4>First Example: Listing data from the Employees table
</h4>
<asp:DataGrid id="dgNamelist" runat="server" GridLines="None" BackColor="LightBlue" Cellpadding="5" BorderWidth="2" BorderColor="Black" ToolTip="Includes only those employees who are at HQ"></asp:DataGrid>
</body>
<script language="JavaScript">
<!--
window.open = SymRealWinOpen;
//-->
</script>
</html>
web.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
<appSettings>
<add key="NWind" value="server=(local)\netSDK database=Northwind; integrated security=true" />
</appSettings>
</configuration>
I have no problem connection with Access OLE DB Access_connection.asp and Schema.aspx please help me to solve my problem I just skipped the SQL Server connection because I can't connect it. And I moved on to chapter 4 I got the same problem datareader.aspx
Thank you in advance