Im trying to implement the example in CH2 on page 61 in the ASP.NET 1.1 Book. All this example does is extract some data from an access database table and puts it into a datagrid on the web page.
My problem is every time I run this, it just gives me a blank page. It seems to compile and run with out any errors. I have copied the code right out of the book and just substituted a database that I had saved on my C drive instead of using there database.
Can anyone here help me with this? Does anyone have any suggestions or ideas? Im starting to pull my hair with this already.
Here is the code.
<%@ Page Language="
vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.
vb" Inherits="DataControlCH2.WebForm1" debug="True"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Oledb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script language="
vb" runat="server">
Sub Page_Load(Sender as Object, E as EventArgs)
Dim myCNN as OleDbConnection
Dim objCommand as OleDbDataAdapter
Dim mySQL as string
Dim strConnect as string
Dim DataSet1 as DataSet
strConnect= "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnect+= "Data Source=C:\Access Work\CompanyDatabase.mdb;"
strConnect+= "Persist Security Info=False"
mySQL= "Select SSN,FName,LName from Employee"
myCNN= New OleDBConnection(strConnect)
objCommand=New OleDBDataAdapter(mySQL,myCNN)
objCommand.Fill(DataSet1,"Employee")
DataGrid1.DataSource=DataSet1.Tables("Employee").D efaultView
DataGrid1.DataBind()
End Sub
</script>
<HTML>
<HEAD>
<title>Data Grid Control Example</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout" BGCOLOR="#ffffff">
<form id="Form1" method="post" runat="server">
<asp:DataGrid ID="DataGrid1" Runat="server" Height="344px" Width="376px" />
</form>
</body>
</HTML>