日期:2012-12-18 浏览次数:20589 次
WebForm2.aspx 文件:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="house.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</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">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 224px; POSITION: absolute; TOP: 16px"
runat="server" Width="272px" Height="350px">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Image id="Image1" runat="server" Width="96px" ImageUrl='<% #DataBinder.Eval(Container,"DataItem.foto") %>'>
</asp:Image>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid></FONT>
</form>
</body>
</HTML>
WebForm2.aspx.vb 文件
Public Class WebForm2
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
'注意: 以下占位符声明是 Web 窗体设计器所必需的。
'不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
Dim sql As String = " select * from userlist "
Dim dataset1 As New DataSet
dataset1 = New DataSet("dataset1")
Dim ConnectionString As String
ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""labrecord.mdb"";Jet OLEDB:Engine Type=5;Provider=""Mic" & _
"rosoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist sec" & _
&nbs