📄 default.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" 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>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="background-image: url(image/cd_ht_1.jpg); width: 1005px; height: 213px">
<tr>
<td style="width: 203px; height: 54px">
</td>
<td style="width: 18px; height: 54px">
</td>
<td style="width: 189px; height: 54px">
</td>
<td style="width: 45px; height: 54px">
</td>
</tr>
<tr>
<td style="width: 203px; height: 131px">
</td>
<td style="width: 18px; height: 131px">
</td>
<td style="width: 189px; height: 131px">
</td>
<td style="width: 45px; height: 131px">
</td>
</tr>
<tr>
<td style="width: 203px; height: 109px">
</td>
<td style="width: 18px; height: 109px">
</td>
<td style="width: 189px; height: 109px">
<table style="border-left-color: #99ccff; border-bottom-color: #99ccff; width: 506px;
border-top-style: ridge; border-top-color: #99ccff; border-right-style: ridge;
border-left-style: ridge; border-right-color: #99ccff; border-bottom-style: ridge">
<tr>
<td style="width: 184px; height: 122px; background-image: url(image/02.JPG); border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none;">
<fieldset style="width: 240px">
<legend class="mainTitle"><span style="font-size: 9pt">通过在控件内编写代码来实现访问Access数据库</span></legend>
<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal" Font-Size="9pt" Height="119px" Width="267px">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
</asp:GridView>
</fieldset>
</td>
<td style="border-left-color: #99ccff; border-bottom-color: #99ccff; width: 100px;
border-top-style: solid; border-top-color: #99ccff; border-right-style: solid;
border-left-style: solid; border-right-color: #99ccff; border-bottom-style: solid; height: 122px; background-image: url(image/02.JPG);">
<fieldset style="width: 240px">
<legend class="mainTitle"><span style="font-size: 9pt">通过AccessDataSource数据源控件访问Access数据库</span></legend>
<asp:GridView ID="GridView2" runat="server" DataSourceID="AccessDataSource1" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="ID" ForeColor="Black" GridLines="None" Font-Size="9pt" Width="280px">
<FooterStyle BackColor="Tan" />
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Age" HeaderText="Age" SortExpression="Age" />
<asp:BoundField DataField="Sex" HeaderText="Sex" SortExpression="Sex" />
</Columns>
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<AlternatingRowStyle BackColor="PaleGoldenrod" />
</asp:GridView>
</fieldset>
</td>
</tr>
<tr>
<td style="width: 184px">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="访问Access数据库"
Width="178px" /></td>
<td style="width: 100px">
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/User.mdb"
SelectCommand="SELECT [ID], [Name], [Age], [Sex] FROM [Info]"></asp:AccessDataSource>
</td>
</tr>
</table>
</td>
<td style="width: 45px; height: 109px">
</td>
</tr>
<tr>
<td style="width: 203px; height: 151px">
</td>
<td style="width: 18px; height: 151px">
</td>
<td style="width: 189px; height: 151px">
</td>
<td style="width: 45px; height: 151px">
</td>
</tr>
</table>
</div>
<br />
<br />
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -