1.使用 GridView 控件和 SqlDataSource 控件显示乐知 班学生名单
来源:互联网 发布:xp设置网络打印机共享 编辑:程序博客网 时间:2024/06/05 02:15
1.使用 GridView 控件和 SqlDataSource 控件显示乐知 班学生名单
<html xmlns="http://www.w3.org/1999/xhtml">
< head runat="server">
<title></title>
< /head>
< body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyTestConnectionString %>"
SelectCommand="SELECT [FName], [FId], [FAge], [FGender] FROM [MyStudents]">
</asp:SqlDataSource>
<br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
CellPadding="3" DataKeyNames="FId" DataSourceID="SqlDataSource1" Height="161px"
Width="291px" AllowPaging="True">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="FName" HeaderText="FName" SortExpression="FName" />
<asp:BoundField DataField="FId" HeaderText="FId" InsertVisible="False" ReadOnly="True" SortExpression="FId" />
<asp:BoundField DataField="FAge" HeaderText="FAge" SortExpression="FAge" />
<asp:BoundField DataField="FGender" HeaderText="FGender" SortExpression="FGender" />
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
</div>
</form>
< /body>
< /html>
<html xmlns="http://www.w3.org/1999/xhtml">
< head runat="server">
<title></title>
< /head>
< body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyTestConnectionString %>"
SelectCommand="SELECT [FName], [FId], [FAge], [FGender] FROM [MyStudents]">
</asp:SqlDataSource>
<br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
CellPadding="3" DataKeyNames="FId" DataSourceID="SqlDataSource1" Height="161px"
Width="291px" AllowPaging="True">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="FName" HeaderText="FName" SortExpression="FName" />
<asp:BoundField DataField="FId" HeaderText="FId" InsertVisible="False" ReadOnly="True" SortExpression="FId" />
<asp:BoundField DataField="FAge" HeaderText="FAge" SortExpression="FAge" />
<asp:BoundField DataField="FGender" HeaderText="FGender" SortExpression="FGender" />
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
</div>
</form>
< /body>
< /html>
- 1.使用 GridView 控件和 SqlDataSource 控件显示乐知 班学生名单
- 使用 GridView 控件和 SqlDataSource 控件显示乐知 班学生名单
- 不使用数据源控件完成显示乐知 班学生名单
- 控件(七)——GridView控件以SqlDataSource控件为数据源显示数据
- gridView和sqlDataSource的使用
- SqlDataSource控件
- SqlDataSource控件
- 使用ObjectDataSource完成显示乐知 班学生名单
- SqlDataSource GridView 显示分类
- 使用 SqlDataSource 控件操作 Access 数据库
- ASP.NET - 对 SqlDataSource 控件使用参数
- ASP.NET -使用 SqlDataSource 控件选择数据
- ASP.NET - 使用 SqlDataSource 控件修改数据
- ASP.NET - 使用 SqlDataSource 控件缓存数据
- 关于SQLDatasource控件的事件和参数
- SqlDataSource和ObjectDataSource控件的区别
- SqlDataSource和ObjectDataSource控件的区别
- 使用GridView控件分页显示数据
- javascript获取鼠标位置部分火狐,ie
- SQL批量添加主键脚本
- .NET FrameWork 小记 (Value Types,Refrence Types, difference)
- SQL Server 2005 没有本地发布选项
- 红帽5下Postfix的设置
- 1.使用 GridView 控件和 SqlDataSource 控件显示乐知 班学生名单
- 用Delphi实现邮件附件收发功能
- sicily 1003 Go To School
- Windows XP上的NFS服务
- 3• 使用ObjectDataSource完成上述题目 (添加select、delete、update和insert对应的类和方法)
- HTML空链接的作用
- SOAP风格中 RPC与Document的区别
- win8心得
- linux添加用户