EntitySpace 常用语句

EntitySpace 这个是很早期的ORM框架,最近发现这个破解的也都不能用了。有谁知道能用的,联系我。

1. where带几个条件的

query.Where(query.ProductTempStatus.Equal((int)tempStatus) | query.ProductStatus.Equal((int)status));

query.Where(query.ProductTempStatus.Equal((int)tempStatus) && query.ProductStatus.Equal((int)status));

2. 批量更新的:

public bool UpdateProductTempStatusBatch(List<int> productIds,ProductTempStatus status)
        {
            try
            {

AwhProducts product = new AwhProducts();
                AwhProductsCollection products = new AwhProductsCollection();
                AwhProductsQuery query = new AwhProductsQuery();

query.Where(query.ProductID.In(productIds));

products.Load(query);

foreach (var item in products)
                {
                    item.ProductTempStatus = (int)status;
                }

products.Save();

return true;

}
            catch (Exception ex)
            {
                return false;
            }

}

3. 使用事务

//MYSQL的事务语句无效

using (esTransactionScope scope = new esTransactionScope())
 {

...

...

product.Save();

brand.Save();

scope.Complete();

}

其它事务的用法:

using (esTransactionScope noTrans = new esTransactionScope(esTransactionScopeOption.Suppress))

using (esTransactionScope rootTrans2 = new esTransactionScope(esTransactionScopeOption.RequiresNew))

查看这里:

http://www.entityspaces.net/blog/CategoryView,category,Transactions.aspx

4.人工执行SQL语句

esUtility util = new esUtility();
int count = (int)util.ExecuteScalar(esQueryType.Text, "Select Count(*) From Employees");

时间: 2024-08-12 03:41:19

EntitySpace 常用语句的相关文章

sql server常用函数、常用语句

一.常用函数 1.字符串函数 : charindex(':','abc:123')    --寻找一个字符在一段字符串中起始的位置 len('zhangsan')   --获取一段字符串的长度 left('Ly,君子之耀',2) --从一段字符串左边返回指定长度的字符 right(char_expr,int_expr)  --返回字符串右边int_expr个字符 substring(expression,start,length) --截取字符串 datalength(Char_expr)  -

SQL 常用语句

–-表现最差的前10名使用查询 SELECT TOP 10 ProcedureName = t.text, ExecutionCount = s.execution_count, AvgExecutionTime = isnull ( s.total_elapsed_time / s.execution_count, 0 ), AvgWorkerTime = s.total_worker_time / s.execution_count, TotalWorkerTime = s.total_wo

SQL常用语句积累

SQL 常用语句积累: 一. SQL 基本语句 SQL 分类: DDL -数据定义语言 (Create , Alter , Drop , DECLARE) DML -数据操纵语言 (Select , Delete , Update , Insert) DCL -数据控制语言 (GRANT , REVOKE , COMMIT , ROLLBACK) 首先 , 简要介绍基础语句: 1 .说明:创建数据库 Create DATABASE database-name 2 .说明:删除数据库 drop d

mysql数据库常用语句2

关于mysql常用语句的整理,上一篇涉及到ddl.dml以及一些简单的查询语句. 1:mysql分页查询 select * from table_name limit 5,10;   从下标为5元素查询,查询10条记录,注意:mysql下标从0开始 2:关联查询 select a.id,a.name,b.id,b.name from table_name a ,table_name b where a.id=b.id;   表a和表b以字段id关联查询 3:比较下面语句 select * fro

Oracle 常用语句整理

Oracle 常用语句整理 最近做了份大型数据库作业.遇到了一些问题,在网上找的很是辛苦,于是,将一些常用的语句记录下来,方便大家学习.都是一些基本的东西.如果忘了,可以来看看. 1.创建临时表空间 create temporary tablespace car_data //car_data,表空间名 tempfile 'C:\Users\Administrator\Desktop\car_data.dbf'//表空间路径 size 50m autoextend on next 50m max

【Oracle】常用语句集合

1 oracle常用经典SQL查询 2 常用SQL查询: 3 4 1.查看表空间的名称及大小 5 6 select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size 7 from dba_tablespaces t, dba_data_files d 8 where t.tablespace_name = d.tablespace_name 9 group by t.tablespace_name; 10 11 2.查看表空间物

SSH查看服务器日志常用语句

SSH客户端查看服务器日志常用语句即为linux进行文件夹进行文件查看的常用语句: 1.cd 2.tail 3.grep [options] pattern file -c:只输出匹配行的计数.-I:不区分大 小写(只适用于单字符).-h:查询多文件时不显示文件名.-l:查询多文件时只输出包含匹配字符的文件名.-n:显示匹配行及 行号.-s:不显示不存在或无匹配文本的错误信息.-v:显示不包含匹配文本的所有行. 面对庞大的日志文件,单独下载并打开文件,从中提取信息的话,很吃力.这时,grep语句

SQL Server性能常用语句

查看各表的数据行数 SELECT o.name, i. ROWS FROM sysobjects o, sysindexes i WHERE o.id = i.id AND o.Xtype = 'U' AND i.indid < 2 ORDER BY o.name; 计算数据库中各个表每行记录所占用空间 --SELECT * FROM Employees AS e; CREATE TABLE #tablespaceinfo ( nameinfo VARCHAR(50) , rowsinfo BI

SQL常用语句集合(不断更新)

1.多条件 查询 上下级 所有数据 select * from OrgUnit where (ParentId = '3' or OrgId='3' or ParentId in (select OrgId from OrgUnit where ParentId='3')) 2.相同列数的 多个查询结果 组合(union all) select a,b,c from table1 union all select ca,cb,cc from table2 3.左外连接 与 右外连接 (left