Here I go again. I've loaded up the eval version of sql server with enterprise manager. I'm not getting any error its just reading the text in the <h4> tags.
My server is name "marinerhome" the database is "northwind"
here is the code:
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.SqlClient" %>
<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"
CellSpacing="5"
BorderWidth="2"
BorderColor="Black"
ToolTip="Includes only those employees who are at HQ" />
<body>
</html>
<script language="
VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "server=(marinerhome); database=Northwind; " & _
"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()
Response.Write("ServerVersion: " & objConnection.ServerVersion & _
vbCRLF & "Datasource: " & objConnection.DataSource & _
vbCRLF & "Database: " & objConnection.Database)
dgNameList.DataSource = objCommand.ExecuteReader()
dgNameList.DataBind()
objConnection.Close()
End Sub
</script>