摘要:#region 数据存取器 /// /// 保存数据 /// public static string theYear; public string SetYear { set { theYear = value; } get { ...
阅读全文
摘要:最近做了一个工资管理系统,大部分采用asp.net 2.0提供的控件发现虽然方便,但还是有好多地方是一定要采用JavaScript才能实现功能的。。 对于这个项目常用到的一些脚本我做了如下总结:1。。//执行客户端脚本,makeSure()是客户段的脚本函数: ClientScript.RegisterStartupScript(this.GetType(), "", "<script>...
阅读全文
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namesp...
阅读全文
摘要:private void button1_Click(object sender, EventArgs e) { listView1.Items.Clear(); listView1.Columns.Clear(); SqlConnection con = new SqlConnection(...
阅读全文
摘要:private void button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("server=.;database=pubs;user id=sa;password=123"); con.Open(); ...
阅读全文
摘要:1 添加外键: alter table 表名1 add constraint 外键名 foreign key (外键字段) references 表名2(外键字段) 2 添加索引(此键一定是汪加了not null后): create unique index 约束名 on 表名(约束字段 desc) 3 添加not null约束 : alter table 表名 alter column 约束列...
阅读全文
摘要://首先要在PageLoad()事件中注册属性 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Button1.Attributes.Add("onclick", "return checkSame()");//为Butto...
阅读全文
摘要:#region 文件写入写出的封装 /// /// 写入文件方法 /// /// 要被写入的文件的路径 /// 要被写入内容 /// public bool StreamWrite(string filePath,string fileConten,HttpServerUtility Server) { ...
阅读全文
摘要://说明:下面的代码是我转一位高手的,希望对大家能有所收或。。 //再声明一下:如果表名与字段名在整个过程中不再变化,则可以用以下模式: //================================= @tableName as varchar(20)='leaveWord',--表名 @fieldList as varchar(1000)='*',--字段列表 @startIndex...
阅读全文
摘要:/* create table tb_log ( _id int identity(1,1) primary key , LogId varchar(10) , event varchar(50), ) */ create trigger our on Test for delete as declare @StuId char(8) declare @name varchar(15) dec...
阅读全文
摘要:protected void Button1_Click(object sender, EventArgs e) { SqlConnection conn; SqlCommand cmd1, cmd2; SqlTransaction tra; conn = new SqlConnection("server=.;databa...
阅读全文
摘要:#region 给表格控件绑定数据库内容 /// /// 水平显示每条记录 /// /// 需要的数据集 /// 需要的table控件 /// 标头,依次从左向右 /// public Table TableBd_Horizontal(DataSet dst, Table tab, string[] SubH...
阅读全文
摘要:#region 对分页控件进行分页的封装 /// /// 分页 /// /// 设定分页大的小 /// 需要的数据集 /// 传递当前页数 /// 返回值解释:返回分页总数:result[0],上一页:result[1],下一页:result[2],pad:result[3] public object [] P...
阅读全文