|
-
Jun 10th, 2002, 09:43 AM
#1
Thread Starter
Lively Member
datagrid problem
Hi,
I am just testing my very first datagrid with little result. When i run the aspx page i get an empty page? the code is below see if can suss out why?
thanks!
-----asp.net code----------
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As New OleDbConnection("c:\helpdesk.mdb")
Dim cmd As OleDbCommand
con.Open()
cmd = New OleDbCommand("Select * from faults", con)
DataGrid1.dataSource = cmd.ExecuteReader()
DataGrid1.DataBind()
con.Close()
End Sub
End Class
---------HTML code----------
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="aspnet.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp ataGrid id="DataGrid1" runat="server" style="Z-INDEX: 101; LEFT: 46px; POSITION: absolute; TOP: 48px" runat="server" Width="532px" Height="186px"></asp ataGrid>
</form>
</body>
</HTML>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|