以前,一直都使用VS.NET 2003和SQL Server 2000,没怎么去接触 VS 2005 和SQL Server 2005。工具版本升级是早晚的事情,于是就开发一个能运行在VS 2005 上的 控件吧。
属先是采用 PowerDesigner 12.0 绘UML图(主要是类图),PowerDesigner 12.0 不支持 C#2.0还无所谓, 让我痛苦的是把类实现interface 里面的属性的get;set生成了方法,比如:
public interface IAAA
{
string ABC
{
get;set;
}
}
public class Test: IAAA
{
public string get_ABC()
{return "";}
public void set_ABC()
{}
}
这个问题希望高手帮忙解决一下,我不希望一个问题在我身上停留太久。
然后,就是编写代码,写了N多行代码啊,由于以前做ASP.net不多,所以速度就慢了点,整整耗费了我一个双休。
一下是.ASPX里的代码:
1
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
2
<%
@ Register Assembly="DAF.Components" Namespace="DAF.Components" TagPrefix="cc1" %>
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" >
5
<head runat="server">
6
<title>无标题页</title>
7
</head>
8
<body style="text-align: center">
9
<form id="form1" runat="server"><cc1:WebPaginationSearch ID="WebPaginationSearch1" runat="server" PageSize="5" /><br />
10
<asp:Label ID="Label1" runat="server" Text="Label" /><br />
11
<asp:GridView ID="GridView1" runat="server" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" >
12
<FooterStyle BackColor="Tan" />
13
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
14
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
15
<HeaderStyle BackColor="Tan" Font-Bold="True" />
16
<AlternatingRowStyle BackColor="PaleGoldenrod" />
17
</asp:GridView>
18
</form>
19
</body>
20
</html>



2



3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

以下是.CS里的代码:
















































至于页长,组长等其他的信息我就没有一一设置了,就采用了控件的默认配置。
测试了几次,程序都通过了。
控件的表现:
一:外表美观(用户可以自定义外观);
二:查询速度快(采用了SQL 92标准的 Row_Number() 函数);
三:程序的扩展性好(以后和容易的升级和查询别的数据库)。
在应用于一个项目,并不出Bug后,我就发布上来,让高手们指点一二阿。