05 2012 档案

摘要:-------------------------(一)准备工作---------------------------CREATE TABLE CUSTOMERCREATE TABLE CUSTOMER(ID INT PRIMARY KEY,CUSTOMER_NAME NVARCHAR(50))--CREATE TABLE PRODUCTIONCREATE TABLE PRODUCTION(ID INT PRIMARY KEY,PRODUCTION_NAME NVARCHAR(100),CUSTOMER_ID_COLLECTIONS NVARCHAR(100))--INSERT INIT DA 阅读全文
posted @ 2012-05-19 19:11 szjdw 阅读(1560) 评论(0) 推荐(1) 编辑
摘要:Enum.GetValues方法:检索指定枚举中常数值的数组。反编译代码:[ComVisible]public static Array GetValues(Type enumType){ if(enumType==null) { throw new ArgumentNullException("enumType"); } return enumType.GetEnumValues();}[DllImport("QCall",CharSet=CharSet.Unicode)]private static extern void GetEnumValued 阅读全文
posted @ 2012-05-18 22:03 szjdw 阅读(3121) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace Tool{ public class CustomAttribute { public static string GetCustomAttribute<T>(Type type) where T:System.Attribute { return type.GetCustomAttributes(typeof(T), false)[0] as stri 阅读全文
posted @ 2012-05-11 17:45 szjdw 阅读(175) 评论(0) 推荐(0) 编辑
摘要:有限状态机(finite-state machine,fsm),又称有限状态自动机,简称状态机,是表示有限个状态以及在这些状态之间的转移和动作等行为的数学模型。概念和术语状态存储关于过去的信息,就是说:它反映从系统开始到现在时刻的输入变化。转移只是状态变更,并且用必须满足来确使状态转移发生的条件来描叙她。动作是在给定时刻要进行的活动的描述。有多种类型的动作:进入动作(entry action):在进入状态时进行退出动作:在退出状态时进行输入动作:依赖于当前状态和输入条件进行转移动作:在进行特定转移时进行fsm(有限状态机)可使用上面图那样的状态图(或状态转移图)来表示。此外可以使用多种类型的状 阅读全文
posted @ 2012-05-11 16:40 szjdw 阅读(281) 评论(0) 推荐(0) 编辑
摘要:存储过程create proc test4@res varchar(10) outputasselect @res=count(*) from Ship_TUser_Infogocs文件:SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@res", SqlDbType.Int) }; paras[0].Direction = ParameterDirection.Output; SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTran 阅读全文
posted @ 2012-05-10 16:23 szjdw 阅读(193) 评论(0) 推荐(0) 编辑
摘要:SqlParameter类的SQlValue与Value的区别:msdn说:SqlVaue是Sql类型的参数值以字符串类型来说,Sql类型有varchar,nvarchar,char等等C#类型有string,字符数组等等SqlValue指代Sql类型的值Value表示C#类型的值在存储结构上及表示范围、精度等方面有区别。 阅读全文
posted @ 2012-05-09 19:54 szjdw 阅读(715) 评论(0) 推荐(0) 编辑
摘要:///<summary>///Parses the specified block of a text///</summary>///<return>///Returns the end position of a parsed block.///</return>protected int ParseBlock(XmlNode parentNode,TagBase parentTag,string text,int position){ #region check the arguments if(parentNode==null) { thr 阅读全文
posted @ 2012-05-07 20:08 szjdw 阅读(180) 评论(0) 推荐(0) 编辑
摘要:///<summary>///the name of the Value xml node.///</summary>protected const string cValueXmlAttributeName="Value";///<summary>///Retrieves the value of the specified tag xml node.///</summary>protected string GetXmlNodeValue(XmlNode node){ if(node==null) { throw new 阅读全文
posted @ 2012-05-07 15:27 szjdw 阅读(146) 评论(0) 推荐(0) 编辑
摘要:///<summary>///the name of the Tag xml node.///</summary>protected const string cTagXmlNodeName="Tag";///<summary>///Determines whether the specified node is a tag node///</summary>protected bool IsTagXmlNode(XmlNode node){ if(node==node) { throw new ArgumentNullExc 阅读全文
posted @ 2012-05-07 15:16 szjdw 阅读(132) 评论(0) 推荐(0) 编辑
摘要:///<summary>///Check whether there is the tag at the specified position in the specified sql///<sumary>///<name>The value of the Name property</name>///<returns>///The position after the tag or -1 there is no tag at the position.///</returns>internal static int Ma 阅读全文
posted @ 2012-05-07 11:39 szjdw 阅读(212) 评论(0) 推荐(0) 编辑
摘要:--根据小类名称和品牌名来取客户信息declare @brandname nvarchar(50)declare @categoryname nvarchar(50) ---分类的中文名set @categoryname='空调'set @brandname='海尔'--取得ClassIDdeclare @categoryid nvarchar(15)if OBJECT_ID('Tempdb.dbo.#categoryids') is not nullbeginprint 'Exists Table Tempdb.dbo.#categor 阅读全文
posted @ 2012-05-04 11:47 szjdw 阅读(194) 评论(0) 推荐(0) 编辑
摘要:--根据小类名称和品牌名来取客户信息declare @brandname nvarchar(50)declare @categoryname nvarchar(50) ---分类的中文名set @categoryname='空调'set @brandname='海尔'--取得ClassIDdeclare @categoryid nvarchar(15)if OBJECT_ID('Tempdb.dbo.#categoryids') is not nullbeginprint 'Exists Table Tempdb.dbo.#categor 阅读全文
posted @ 2012-05-04 09:35 szjdw 阅读(211) 评论(0) 推荐(0) 编辑
摘要:--根据小类名称和品牌名来取客户信息declare @brandname nvarchar(50)declare @categoryname nvarchar(50) ---分类的中文名set @categoryname='空调'set @brandname='海尔'--取得ClassIDdeclare @categoryid nvarchar(15)if OBJECT_ID('Tempdb.dbo.#categoryids') is not nullbegin print 'Exists Table Tempdb.dbo.#catego 阅读全文
posted @ 2012-05-03 18:02 szjdw 阅读(157) 评论(0) 推荐(0) 编辑
摘要:接口比类关系来约定变量的使用范围更直观明了 阅读全文
posted @ 2012-05-02 19:43 szjdw 阅读(87) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Reflection;using System.Collections;namespace Tool{ public class DataTable2Object { /// <summary> /// Convert an DataRow to an object /// </summary> /// <typeparam name=&qu 阅读全文
posted @ 2012-05-02 17:20 szjdw 阅读(873) 评论(0) 推荐(0) 编辑