|
@ -30,13 +30,13 @@ namespace OrmTest |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
//sql
|
|
|
//sql
|
|
|
var dt = db.Ado.GetDataTable("select * from [order] where @id>0 or name=@name", new List<SugarParameter>(){ |
|
|
var dt = db.Ado.GetDataTable("select * from \"ORDER\" where @id>0 or name=@name", new List<SugarParameter>(){ |
|
|
new SugarParameter("@id",1), |
|
|
new SugarParameter("@id",1), |
|
|
new SugarParameter("@name","2") |
|
|
new SugarParameter("@name","2") |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//sql
|
|
|
//sql
|
|
|
var dt2 = db.Ado.GetDataTable("select * from [order] where @id>0 or name=@name", new { id = 1, name = "2" }); |
|
|
var dt2 = db.Ado.GetDataTable("select * from \"ORDER\" where @id>0 or name=@name", new { id = 1, name = "2" }); |
|
|
|
|
|
|
|
|
//Stored Procedure
|
|
|
//Stored Procedure
|
|
|
//var dt3 = db.Ado.UseStoredProcedure().GetDataTable("sp_school", new { name = "张三", age = 0 });
|
|
|
//var dt3 = db.Ado.UseStoredProcedure().GetDataTable("sp_school", new { name = "张三", age = 0 });
|
|
@ -47,9 +47,9 @@ namespace OrmTest |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//There are many methods to under db.ado
|
|
|
//There are many methods to under db.ado
|
|
|
var list= db.Ado.SqlQuery<Order>("select * from [order] "); |
|
|
var list= db.Ado.SqlQuery<Order>("select * from \"ORDER\""); |
|
|
var intValue=db.Ado.SqlQuerySingle<int>("select 1"); |
|
|
var intValue=db.Ado.SqlQuerySingle<int>("select 1 from dual"); |
|
|
db.Ado.ExecuteCommand("delete [order] where id>1000"); |
|
|
db.Ado.ExecuteCommand("delete \"ORDER\" where id>1000"); |
|
|
//db.Ado.xxx
|
|
|
//db.Ado.xxx
|
|
|
Console.WriteLine("#### Ado End ####"); |
|
|
Console.WriteLine("#### Ado End ####"); |
|
|
} |
|
|
} |
|
|