摘要:
create table t3(a char(10),b char(10),c char(10),d char(10))create table te(a varchar(10) primary key not null,b int)insert into te values('1',200)insert into te values('',1)select * from teALTER TABLE te ADD CONSTRAINT CK_b CHECK(b>=1)GO------------------------------------------- 阅读全文
摘要:
class Program { //委托的参数个数和类型必须和委托穿的方法参数个数和类型必须保持一致 //申明委托的泛型参数 (T, U) 好处是不必关心要知道具体调用方法的参数类型 //在调用委托的时候,可以是任意类型的参数 public delegate T Del<T>( T sender ) 阅读全文
摘要:
public class Person { //当 lhs> rhs的时候,就进行交换位置public void SwapIfGreater<T>( ref T lhs, ref T rhs ) where T : System.IComparable<T> { T temp; if ( lhs.CompareTo( rhs ) > 0 ) { temp = lhs; lhs = rhs; rhs = temp; } } }class Program { static void Main( string[ ] args ) { Person p = new 阅读全文