unionsql.aspx
来自「用VB实现」· ASPX 代码 · 共 60 行
ASPX
60 行
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet
id="dsUnion"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_connSales") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_connSales") %>'
CommandText='<%# "SELECT Suppliers.SupplierID, Suppliers.SupplierName ,Products.ProductName FROM Suppliers INNER JOIN Products ON Suppliers.SupplierID = Products.SupplierID ORDER BY Suppliers.SupplierID" %>'
Debug="true" PageSize="20"
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显示JOIN数据</title>
</head>
<body>
<form runat="server">
<asp:DataGrid id="DataGrid1"
runat="server"
AllowSorting="False"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
ShowFooter="false"
ShowHeader="true"
DataSource="<%# dsUnion.DefaultView %>"
PagerStyle-Mode="NextPrev"
AllowPaging="true"
AllowCustomPaging="true"
PageSize="<%# dsUnion.PageSize %>"
VirtualItemCount="<%# dsUnion.RecordCount %>"
OnPageIndexChanged="dsUnion.OnDataGridPageIndexChanged"
>
<HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<Columns>
<asp:BoundColumn DataField="SupplierID"
HeaderText="供应商编号"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="SupplierName"
HeaderText="供应商名称"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="ProductName"
HeaderText="商品名称"
ReadOnly="true"
Visible="True"/>
</Columns>
</asp:DataGrid>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?