使用SqlServer2005 Service Broker 和 SqlDependency类提供数据更改的通知
摘要:/*注意 * 使用SqlServer2005 Service Broker 和 SqlDependency类提供数据更改的通知,注意一下几点 * 1.检测是否已经启用Service Broker * Select DATABASEpRoPERTYEX('数据库名称','IsBrokerEnabled
阅读全文
posted @
2014-09-05 11:39
zxd543
阅读(209)
推荐(0)
C#指针操作
摘要:C#中慎用指针 1.指针运算: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace PointerPlaygroubnd { class Program { /
阅读全文
posted @
2014-06-21 18:37
zxd543
阅读(169)
推荐(0)
C#—集合(Collection)
摘要:1.栈(stack)using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace Stack{ class Program { static void ...
阅读全文
posted @
2014-06-14 10:20
zxd543
阅读(370)
推荐(0)
C#_事件委托
摘要:CarDealer类 事件发布程序using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace DelegateEvent{ public class CarInfoEve...
阅读全文
posted @
2014-06-06 11:07
zxd543
阅读(174)
推荐(0)
C#—委托分析
摘要:1.简单委托示例using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace SimpleTest{ class Program { private d...
阅读全文
posted @
2014-05-30 10:01
zxd543
阅读(144)
推荐(0)
泛型方法和空值
摘要:数据库中的数字和编程语言中的数字有显著的不同,数据库中的数字可以为空,C#中的数字不能为空。int? x = null; //此时x可以为空测试类(NullableTest)using System;using System.Collections.Generic;using System.Linq...
阅读全文
posted @
2014-05-08 16:00
zxd543
阅读(456)
推荐(0)
泛型类的功能
摘要:泛型类的功能:默认值、约束、继承、静态成员 。以从队列中读取文档为例泛型继承:子类和基类泛型类型一致或指定基类的泛型类型泛型的静态成员: 只能类的一个实例中共享 public class StaticDemo { public static int x; ...
阅读全文
posted @
2014-05-08 10:56
zxd543
阅读(158)
推荐(0)
创建泛型类
摘要:节点类(LinkedListNode)using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace List{ public class LinkedListNode ...
阅读全文
posted @
2014-05-06 10:13
zxd543
阅读(188)
推荐(0)
XML数据的读取—数据库配置文件
摘要:数据库配置文件(config.xml) View Code 引用命名空间(using System.Xml;)读取XML中的数据库连接字符串 /// /// 读取XML中的数据数据库连接字符串 /// /// /// /// private string ConfigGetValues(string key) { string strRes = string.Empty; Xml...
阅读全文
posted @
2014-02-25 15:32
zxd543
阅读(2287)
推荐(0)
Config配置文件读写
摘要:config文件读写操作(文字说明附加在程序中)App.config文件 HTML代码 ]]> ...
阅读全文
posted @
2014-02-24 14:43
zxd543
阅读(343)
推荐(0)
设置屏幕快捷键
摘要:设置屏幕按钮的快捷键方法:KeyPreview的属性设置为True //设置快捷键 private void TestMain_KeyDown(object sender, KeyEventArgs e) { if(e.Modifiers.Compa...
阅读全文
posted @
2014-02-19 09:14
zxd543
阅读(306)
推荐(0)
哈希表的简单使用
摘要:常见功能在哈希表中添加一个key/键值对:HashtableObject.Add(key,);在哈希表中去除某个key/键值对:HashtableObject.Remove(key);从哈希表中移除所有元素: HashtableObject.Clear();判断哈希表是否包含特定键key: HashtableObject.Contains(key);测试用例如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections; //哈希表引用na
阅读全文
posted @
2013-09-07 11:46
zxd543
阅读(209)
推荐(0)
C#反射—解决类的实例化问题
摘要:利用简单工厂模式来改进抽象工厂使用的复杂性(抽象工厂详见 设计模式之—抽象工厂模式)数据表(User)业务处理接口(IUser)namespace FactoryMethodPatternDB.CLASS{ interface IUser { void Insert(User user); void GetUser(string id); }}View Code 数据表(Department)业务处理接口(IDepartment)namespace FactoryMethodPatternDB.CLASS{ interface IDepart...
阅读全文
posted @
2013-08-10 17:52
zxd543
阅读(479)
推荐(1)
C#之—委托
摘要:(1)定义委托:(百度百科样例,只有写了才有收获)namespace Entrust{ public delegate void GreetingDelegate(string name); //定义委托 class Class1 { public void EnglishGreeting(string name) { Console.WriteLine("Good Morning." + name); } public void ChineseGreeting(string name) ...
阅读全文
posted @
2013-08-09 19:56
zxd543
阅读(184)
推荐(0)