使用Expression 生成sql update语句的时候遇到了个问题 ,Expression<Action<T>> la 这个委托里面老获取不到 引用类型的值,甚至连变量的值都不好获取 只能获取常量(ConstantExpression)的值 折腾一晚上之后终于找到解决方案 if (sqlWhere == "") return 0; Type type = typeof(T); var param = ReflectionUtil.CreateIns…
在EF中,我们查询数据时可能会用拉姆达表达式 Where(Func<T,ture> func)这个方法来筛选数据,例如,我们定义一个User实体类 public class User { public Guid Id { get; set; } public string LoginId { get; set; } public string Name { get; set; } public bool Enabled { get; set; } public DateTime Create…
一.PowerDesigner生成sql问题 生成sql的方法是 Database -->Generate Database (Ctrl + G ) 但是提示 Could not load VBScript engine. Check VBScript installation. Generation aborted due to errors detected during the verification of the model. 检查了好久 发现将check model 去掉就可以了!其…
转:http://www.cnblogs.com/the7stroke/archive/2012/04/22/2465597.html using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; using System.Data; public class SQLHelper { /// <summary> /// 插入单个实例 /…
项目开始一般都是用word保存下数据库的文档 但是从表单一个一个的建表实在是很困难乏味,查查资料 1.可以生成一个html或者xml,检索结构生成sql.但是这个方式也蛮麻烦 2.查到vba可以操作word读取表格.所以采用这种方式写了一个小程序.这样就可以直接生成sql了,在这里做个记录. 代码很初级,意见欢迎,勿喷. Public Sub test() 'Word对象定义 Dim objWord As New Word.Application Dim objWordNew As New Wo…
批量更改数据库表架构(生成sql后直接执行!) use my_test; --当前数据库 ), ), ), @NewSql VARCHAR(max), @Index INT; SET @SchemaOld='dbo';--原架构名称 SET @SchemaNew='SC';--新架构名称 SET @NewSql=''; ; SELECT @alltable=isnull(@alltable+',','')+[name] FROM SysObjects Where XType='U' ORDER…