| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Dapper执行存储过程返回datatable数据(不带参数) |
| | | /// </summary> |
| | | /// <param name="sql">存储过程名</param> |
| | | /// <returns></returns> |
| | | public static bool IsProcedureNo(string sql) |
| | | { |
| | | bool result; |
| | | //sql语句 |
| | | using (IDbConnection conn = sqlConnection()) |
| | | { |
| | | try |
| | | { |
| | | DataTable table = new DataTable(); |
| | | //var data = conn.ExecuteReader(sql, parm); |
| | | var res = conn.ExecuteReader(sql);//sql 存储过程 |
| | | result = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //创建日志记录组件实例 |
| | | LogHelper.WriteLog(ex); |
| | | result = false; |
| | | throw ex; |
| | | } |
| | | finally |
| | | { |
| | | conn.Dispose(); |
| | | conn.Close(); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Dapper查询返回数据条数 |
| | | /// </summary> |
| | | /// <param name="sql"></param> |