public void SOHSelecting(int startRowIndex, int maximumRows, string sortExpression, string location) { ; IList<Logistics.LogisticsBinReference> getSOHList = new List<LogisticsBinReference>(); var list = View.SohLists.Where(c => c.SubInvento…
先定义一个枚举类型 , 初中, 高中,大学 }; int ->enum int d=2; PropertyType a=(PropertyType)d; int <- enum PropertyType d = PropertyType.小学; int a = Convert.ToInt32(d); Enum类有关的方法 Enum.Parse 方法 (Type, String) 将一个或多个枚举常数的名称或数字值的字符串表示转换成等效的枚举对象. public static Object…
1.删除所有表 select 'drop table '+name+';' from sys.tables where name like 'DataSyncV1DelaySample%' or name like 'DataSyncV2DelaySample%' 2.递归查询 使用关键字with as with temp ( [Id], [parentid]) as ( select Id, ParentId from SysLocation where ParentId = @ParentI…
枚举部分 Enumeration part 使用枚举我们可以定义一些有名字的数字常量. 枚举通过 enum关键字来定义. Using enumerations, we can define some numeric constants with names. Enumeration is defined by the enum keyword. enum Direction { Up = 1, Down, Left, Right } 枚举是在运行时真正存在的一个对象,其中一个原因是因为这样可以从…
默认下,C#只有两种类型: 1. 可空类型:(是指可为null) 大部分的对象, 如: Dog dog = null; 2. 不可空类型: 基本值类型,布尔类型等,如: int a = 0 ;//正确 int a = null;//错误 3. 不可空转为可空类型的方法: int? a = null; //在不可空类型后面加上问号"?"就可以转换为可空类型了 小提示: 在数据库中int类型也是可以为空的,微软为了在概念上保持一致才推出了此举, 当然它的意义并不止如此,继续深入探究吧.…
异常信息: "指定的架构无效.错误: CLR 类型到 EDM 类型的映射不明确,因为多个 CLR 类型与 EDM 类型“Person”匹配. 以前找到的是 CLR 类型“A.Person”, 新找到的则是 CLR 类型“B.Person”. 这类异常信息在代码里面出现过几次,每次的解决方案都让人匪夷所思.不知道为什么出现,也不知道为什么被解决了. 查阅了一些国外的资料,链接: Don't use classes with the same name - EF uses only class na…
前景提要: 编写程序时,也许你不经意间,就不知不觉的定义了错误的类型,从而发生了额外的性能消耗,从而降低了效率,不要说就发生那么一次两次,如果说是程序中发生了循环.网络程序(不断请求处理的)等这些时候,减少了不必要额外的消耗,使优化程序提高效率的一种途径.不仅跬步,无以至千里,不积小流,无以至江河.优化从点点滴滴做起. 一.问题抛出: 大家先看这么一段定义 class ReserveData { public string ReserveId; public string patient_…