.NET经验心得探讨社区  
请在这里用键盘敲打出属于你的地位!

2007年8月28日

摘要: using System.Drawing; using System.ComponentModel; using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential)] public struct SystemTime { public ushort wYear; public ushort wMonth; pub... 阅读全文
posted @ 2007-08-28 15:35 苦涩的咖啡 阅读(665) 评论(0) 推荐(0) 编辑

2007年1月23日

摘要: IN&EXISTS与NOT IN&NOT EXISTS 的优化原则的讨论1.EXISTS的执行流程 select * from t1 where exists ( select null from t2 where y = x )可以理解为: for x in ( select * from t1 ) loop if ( exists ( select null from t2 ... 阅读全文
posted @ 2007-01-23 14:40 苦涩的咖啡 阅读(574) 评论(0) 推荐(0) 编辑

2007年1月17日

摘要: truncate table TableName 阅读全文
posted @ 2007-01-17 16:24 苦涩的咖啡 阅读(621) 评论(0) 推荐(0) 编辑

2006年12月28日

摘要: // 名称:全截取函数 // 功能:把指定的文本中左边和右边的空格全部截取 // 返回:已经截取的文本 // 参数:text 指定的文本 function trimAll(text) { return leftTrim(rightTrim(text));//先右截取,再左截取,返回 } // 名称:左截取函数 // 功能:把指定的文本中左边的空格全部截取 // 返回:已经截取的文本 // 参数:t... 阅读全文
posted @ 2006-12-28 14:21 苦涩的咖啡 阅读(2105) 评论(0) 推荐(0) 编辑

2006年12月21日

摘要: 有成绩表T_Score(Stu_id和Lession_id为联合主键)缺考情况不录入,例如B001的L002课程缺考。Stu_id(学生号) Lession_id(课程) Score(成绩)A001 L001 90A001 L002 80A002 L001 70A002 L002 60B001 L001 50B002 L001 85…… …… ... 阅读全文
posted @ 2006-12-21 17:49 苦涩的咖啡 阅读(427) 评论(0) 推荐(0) 编辑

2006年12月14日

摘要: public static string GetGb2312() { Encoding gb = Encoding.GetEncoding("gb2312"); //获取GB2312编码页(表) object[] bytes = CreateRegionCode(4); //调用函数产生4个随机中文汉字编码 string str = gb.GetString((byte[])Convert.Ch... 阅读全文
posted @ 2006-12-14 11:33 苦涩的咖啡 阅读(258) 评论(0) 推荐(0) 编辑

2006年10月10日

摘要: http://dotnet.blyct.com/QuickStartv20/aspnet/default.aspx很好的ASP.NET 2.0 快速入门教程 阅读全文
posted @ 2006-10-10 16:34 苦涩的咖啡 阅读(174) 评论(0) 推荐(0) 编辑

2006年9月12日

摘要: 在DataGrid的ItemDataBound事件里写e.Item.Cells[0].Text = ((Datagrid1.PageCount-1) * Datagrid1.PageSize+(e.Item.ItemIndex + 1)).ToString();或e.Item.Cells[0].Text = ((Datagrid1.PageSize * Datagrid1.CurrentPageI... 阅读全文
posted @ 2006-09-12 15:04 苦涩的咖啡 阅读(295) 评论(0) 推荐(0) 编辑

2006年9月4日

摘要: public static string Encode3(string data) { string Pwd = ""; byte[] bytes = System.Text.Encoding.ASCII.GetBytes(data); for (int i = 0; i < bytes.Length; i++) { //Console.WriteLine(bytes[i].ToString... 阅读全文
posted @ 2006-09-04 17:12 苦涩的咖啡 阅读(346) 评论(0) 推荐(0) 编辑

2006年9月1日

摘要: public static string ExportCSV(DataSet ds) { string data = ""; foreach (DataTable tb in ds.Tables) { //写出列名 foreach (DataColumn column in tb.Columns) { data += column.ColumnName + ","; } data += "\n";... 阅读全文
posted @ 2006-09-01 17:34 苦涩的咖啡 阅读(603) 评论(0) 推荐(0) 编辑

2006年8月18日

摘要: 方法一:在c#里执行cmd命令,net start/stop mssqlserver方法二:// 使用 Windows 服务控制器来启动或停止服务using System;using System.Windows.Forms;using System.ServiceProcess;class Test : Form{Test(){Button btn1 = new Button();btn1.Pa... 阅读全文
posted @ 2006-08-18 10:56 苦涩的咖啡 阅读(1462) 评论(1) 推荐(2) 编辑
 
摘要: 本程序用到的控件只有三个按钮,分别为:重启,关机,退出。 打开右边的“解决方案资源管理器”--展开树结构--引用--添加引用---在弹出的对话框中找到System.Management---双击添加它---确定,即建成对System.Management.dll的引用。然后在程序的开头再写入 using System.Management; using System.Run... 阅读全文
posted @ 2006-08-18 10:54 苦涩的咖啡 阅读(677) 评论(0) 推荐(0) 编辑

2006年8月1日

摘要: <meta http-equiv="refresh" content="0;url=/Index.aspx"> 其中的"0"是时间! 阅读全文
posted @ 2006-08-01 15:20 苦涩的咖啡 阅读(217) 评论(0) 推荐(0) 编辑
 
摘要: public class JavaScript{public JavaScript(){//// TODO: 在此处添加构造函数逻辑//}/// <summary>/// 页面弹出消息框/// </summary>/// <param name="Message">消息</param>public static void Alert(string M... 阅读全文
posted @ 2006-08-01 09:57 苦涩的咖啡 阅读(538) 评论(0) 推荐(0) 编辑
 
摘要: public class ExPDF{ static string sqlStr = "select Member_Value from MDB_Archive_Member where Member_ID in (000000,000000) order by Member_ID "; int dtc; Document document = new Document(); static Ba... 阅读全文
posted @ 2006-08-01 09:56 苦涩的咖啡 阅读(514) 评论(1) 推荐(0) 编辑

2006年7月19日

摘要: 在数据库本地执行:sp_configure 'c2 audit mode' ,1RECONFIGURE然后将数据库服务停止在启动就可以了!建立的跟踪文件位置在SQL SERVER安装目录的\MSSQL\Data目录下以***********.trc结尾的就是! 阅读全文
posted @ 2006-07-19 17:49 苦涩的咖啡 阅读(335) 评论(0) 推荐(0) 编辑

2006年6月28日

摘要: 模式窗口导出文件解决办法(恶~)在导出按钮的位置放一个<iframe id="educe" frameborder="0" scrolling="no" width="120" height="20" src="页面连(供导数据用)接"></iframe>在<iframe>里面的页面上写做个按钮把这个按钮左靠其!在页面上写<body style="marg... 阅读全文
posted @ 2006-06-28 10:20 苦涩的咖啡 阅读(251) 评论(0) 推荐(0) 编辑

2006年5月31日

摘要: alter table 表 drop constraint 约束名GOalter table 表 alter column 字段 char(30)not nullGOalter table 表 add constraint 约束名 primary key(字段)GO 阅读全文
posted @ 2006-05-31 11:24 苦涩的咖啡 阅读(2996) 评论(0) 推荐(0) 编辑

2006年4月4日

摘要: 描述 对String对象编码以便它们能在所有计算机上可读, 语法 escape(charstring) charstring参数是要编码的String对象。 说明 escape返回一个包含了charstring内容的新的String对象(Unicode格式),所有空格、标点、重音符号以及其他非ASCII字符都用1编码代替,其中xx等于表示该字符的十六进制数。例如,空格返回的是""。 字符的值大于2... 阅读全文
posted @ 2006-04-04 15:25 苦涩的咖啡 阅读(311) 评论(0) 推荐(0) 编辑

2006年3月31日

摘要: 示例代码下载4K 在已经发布的 ASP.NET2.0 中,无刷新页面开发相关部分同 beta2 有不少改动。而且在越来越多的 Ajax 开发包被开发出来的情况下, ASP.NET2.0 自带的无刷新页面技术没有被很多人了解,甚至不少人认为该功能有些“鸡肋”。但如果我们仅仅是在程序中加入很少部分的 Ajax 特性, Atlas 、 Ajax.Net 等就显得有些“... 阅读全文
posted @ 2006-03-31 17:03 苦涩的咖啡 阅读(310) 评论(0) 推荐(0) 编辑