摘要:        
使用Linq to Entities的时候发生如下异常:Unable to create a constant value of type 'Closure type'. Only primitive types ('such as Int32, String, and Guid') are supported in this context. 代码是这样的:ctx.Products.Where(p => p.Status == (int)s).ToString();其中s是类型为ProdcutStatus的枚举类型:public enum Prodcut    阅读全文
        
            posted @ 2010-12-28 16:05
Angelo Lee
阅读(245)
评论(0)
推荐(0)
        
            
        
        
摘要:        
调用Type.InvokeMember()时出现MissingMethodException经常是由于缺少必要的BindingFlags引起的。在关于Type.InvokeMember Method的地方有一大段例子代码。这段代码中有一个片断是“//Call an instance method”,其中BindingFlags用的是BindingFlags.Public | BindingFlags.InvokeMethod,即:form1.GetType().InvokeMember( "ShowDialog ", BindingFlags.Public | Bindin    阅读全文
        
            posted @ 2010-12-28 13:51
Angelo Lee
阅读(383)
评论(0)
推荐(0)
        
 
                     
                    
                 
                    
                 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号