I am unable to see the grid or the data. Here is my code from my .aspx file. I don't know what I am doing wrong:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="resumesearch.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Resume Search</title>
<style type="text/css">
.style1
{
font-size: x-large;
color: #FF0000;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server"
style="font-size: xx-large; font-weight: 700"
Text="RESUME SEARCH"></asp:Label>
<br />
<br />
<span class="style1">CLICK THE HEADING LINK TO SORT<br />
<br />
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="First Name" HeaderText="First Name"
SortExpression="First Name" />
<asp:BoundField DataField="Last Name" HeaderText="Last Name"
SortExpression="Last Name" />
<asp:BoundField DataField="Address1" HeaderText="Address1"
SortExpression="Address1" />
<asp:BoundField DataField="Address2" HeaderText="Address2"
SortExpression="Address2" />
<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
<asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
<asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" />
<asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
<asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
<asp:BoundField DataField="School Name" HeaderText="School Name"
SortExpression="School Name" />
<asp:BoundField DataField="College Name" HeaderText="College Name"
SortExpression="College Name" />
<asp:BoundField DataField="Years Completed" HeaderText="Years Completed"
SortExpression="Years Completed" />
<asp:BoundField DataField="Degree" HeaderText="Degree"
SortExpression="Degree" />
<asp:BoundField DataField="Currently Working" HeaderText="Currently Working"
SortExpression="Currently Working" />
<asp:BoundField DataField="Job Title" HeaderText="Job Title"
SortExpression="Job Title" />
<asp:BoundField DataField="Months at Job" HeaderText="Months at Job"
SortExpression="Months at Job" />
<asp:BoundField DataField="Years at Job" HeaderText="Years at Job"
SortExpression="Years at Job" />
<asp:BoundField DataField="Job Category" HeaderText="Job Category"
SortExpression="Job Category" />
<asp:BoundField DataField="Expected Pay" HeaderText="Expected Pay"
SortExpression="Expected Pay" />
<asp:BoundField DataField="Available Start Date"
HeaderText="Available Start Date" SortExpression="Available Start Date" />
</Columns>
</asp:GridView>
</span>
</div>
</form>
</body>
</html>
Here is my .aspx.vb (code behind) file:
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Data.OleDb
Imports System.Data.OleDb.OleDbConnection
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load
Dim Panel1 As Panel
Dim Panel2 As Panel
Dim dtCustomerInfo As Data.DataTable
dtCustomerInfo = GetQuery("SELECT * FROM resumetable")
GridView1.DataSource = dtCustomerInfo
GridView1.DataBind()
Panel1.Visible = False
Panel2.Visible = True
End Sub
Private Function GetQuery(strSQL As String) As DataTable
Dim dbConn As Data.OleDb.OleDbConnection
Dim ExecuteReader as System.Data.OleDb.OleDbConnection
Dim cmdSQL As Data.OleDb.OleDbCommand
Dim dtResults As Data.DataTable
dbConn = (New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\hosting/djbconsulting/access_db/buddyschampion.mdb"))
cmdSQL = New Data.OleDb.OleDbCommand(strSQL, dbConn)
dbConn.Open()
dtResults.Load(cmdSQL.ExecuteReader())
dbConn.Close()
Return dtResults
End Function
End Class