原理:需要开启事务的Action贴上Transaction标签,则Action执行前开启事务,Action执行完提交事务,如果Action报错,则回滚事务. OracleHelper代码: using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using…
闲着没事自己写了一个OracleHelper类,希望大神给点建议优化 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.OracleClient; namespace Common { public class DBHelper { private string connectionstring { ge…
支持Oracle.MSSQL.MySQL.SQLite四种数据库,支持事务,支持对象关系映射:已在多个项目中实际使用. 没有语法糖,学习成本几乎为0,拿来即用. DBHelper类完整代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Data.Common; usin…
using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Data.OracleClient; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; namespace BloodWeb.Common { /// <summar…
分享一个拿即用的oraclehelper 首先要引用本机中的oralce access,如果是64位的话,也必须是64位运行,不然会报连接为空connection 等于null. using Oracle.DataAccess; using Oracle.DataAccess.Client; public class OraHelper { public static string connectionString; private static OracleConnection conn; s…
using System; using System.Collections.Generic; using System.Text; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Reflection; /// <summary> /// 数据库助手 /// @浅时光 /// #zuxuguang@163.com /// </summary> name…
随着学的东西越来越多,一点点的完善吧! using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Configuration; namespace _2016_11_21 { public static class DBHelper { //从配置文件里读连接数据库…
DBHelper: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SqlClient; using System.Data.Sql; using System.Data; namespace DAL { public class DBhelper { private stati…