上一页 1 2 3 4 5 6 7 ··· 14 下一页
摘要: 大家都知道在sql server中利用for xml path语句能够把查询的数据生成xml数据,下面是他的一些应用实例:DECLARE @TempTable table(UserID int , UserName nvarchar(50));insert into @TempTable (UserID,UserName) values (1,'a')insert into @TempTable (UserID,UserName) values (2,'b')select UserID,UserName from @TempTable FOR XML PATH运 阅读全文
posted @ 2012-04-28 11:42 szjdw 阅读(204) 评论(0) 推荐(0) 编辑
摘要: ado.net2.0 增强了数据提供程序的架构,并引入了工厂类,每个.net数据提供程序包括一个派生于基类DbProviderFactory的工厂类,工厂类表示该提供程序特有的各种服务的入口点。下面列出了一个工厂类的主要方法:CreateCommand 返回一个提供程序特有的命令对象CreateCommandBuilder 返回一个提供程序特有的命令创建者对象CreateConnection 返回一个提供程序特有的连接对象CreateDataAdapter 返回一个提供程序特有的适配器对象CreateParameter返回一个提供程序特有的参数对象如何获得一个特有的数据提供程序的工厂呢?通过使 阅读全文
posted @ 2012-04-24 17:36 szjdw 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 模糊查询like的用法如下:sql对like操作中的特殊字符处理方法:sql server查询过程中,单引号'是特殊字符,所以在查询的时候要转换成双单引号''。在like操作还有以下特殊字符:下划线_,百分号%,方括号[],尖号^。其用途如下:_:用于代替一个任意字符(相当于正则表达式中的?)%:用于代替任意数目的任意字符(相当于正则表达式中的*)[]:用于转义(事实上只有左方括号用于转义,右方括号使用最近优先原则匹配最近的左方括号)^:用于排除一些字符进行匹配以下是一些匹配的举例,需要说明的是,只有like操作才有这些特殊字符,=操作是没有的a_b... a[_]%a 阅读全文
posted @ 2012-04-23 18:48 szjdw 阅读(512) 评论(0) 推荐(0) 编辑
摘要: Question:I am using Windbg to disassembly managed code (written in c#,console application) using Windbg's !U command from sos.dll.I find when using !u to disassemble a managed function ,the disassebled IL code only contains function calls i made ,and for remaining parts(non-function call C# code 阅读全文
posted @ 2012-04-21 16:30 szjdw 阅读(203) 评论(0) 推荐(0) 编辑
摘要: AttributeUsage类是一个预定义的属性类,以帮助我们控制自定义属性的使用.也就是我们可以定义自定义属性类的属性.这个类描述了如何使用自定义的属性类.AttributeUsage有三个数据属性可用以修饰我们的自定义的属性.ValidOn 定义了自定义属性在哪些程序实体上可被使用.这个可使用实体列表可通过 AttributeTargets枚举类型的OR操作进行设置AllowMutiple 定义了是否可在同一个程序实体上同时使用多个属性进行修饰Inherited 定义了自定义的修饰是否可由被修饰类的派生类继承 让我们做点具体的吧。我们将会用一个AttributeUsage属性修饰我们的属. 阅读全文
posted @ 2012-04-20 11:14 szjdw 阅读(233) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection.Emit;namespace ConsoleApplication1{ public delegate System.String FeedbackToString(); class Program { static void Main(string[] args) { DynamicMethod dynamicMethod = new DynamicMethod(System.Str 阅读全文
posted @ 2012-04-18 15:12 szjdw 阅读(620) 评论(0) 推荐(0) 编辑
摘要: Look at the MSIL and the native machine code for methods generated through Reflrction.Emit.1,Now let us look at the stack.Execute the command "!clrstack".You'll get the stack pointer and instruction pointer for each frame.The result should look something like this:!clrstackOS Thread Id 阅读全文
posted @ 2012-04-17 22:08 szjdw 阅读(439) 评论(0) 推荐(0) 编辑
摘要: Loads the element containing an object reference at a specified array index onto the top of the evaluation stack as type O(object reference).The stack transitional behavior,in sequential order,is:1,An object reference array is pushed onto the stack;2,An index value index is pushed onto the stack;3,i 阅读全文
posted @ 2012-04-17 14:48 szjdw 阅读(282) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;using System.Reflection.Emit;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { DynamicMethod dynamicMethod = new DynamicMethod("Test",null,new Type[]{typ 阅读全文
posted @ 2012-04-16 11:34 szjdw 阅读(232) 评论(0) 推荐(0) 编辑
摘要: Reflection.Emit的作用是能够在程序运行的时候动态生成Class,Method和Field.这样带来的好处是在程序运行的时候产生DynamicProxy,从而可以达到AOP拦截的作用(就是AOP.NET的实现原理).由于Emit中提供了TypeBuilder(生成Class的类),MethodBuilder(生成Method的类)以及FieldBuilder(生成类的成员变量的类)等等.由于MethodBuilder只能生成函数的申明,不能生成函数的执行代码,所以要想生成一个完整的函数,就不可避免的要用到ILGenerator类.ILGenerator只能通过Emit(...)函数 阅读全文
posted @ 2012-04-14 18:57 szjdw 阅读(290) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 14 下一页