62 lines
1.6 KiB
C#
62 lines
1.6 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using CRVM.Utility;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Collections;
|
|||
|
|
using System.Data.OracleClient;
|
|||
|
|
using System.Data.OleDb;
|
|||
|
|
|
|||
|
|
namespace CRVM
|
|||
|
|
{
|
|||
|
|
public class LogicCon
|
|||
|
|
{
|
|||
|
|
private IDBAccess projDB = null;
|
|||
|
|
private StringConnectItem connstrItem = null;
|
|||
|
|
public EDBItem dbItem;
|
|||
|
|
//public string sorcStrs = "";
|
|||
|
|
//private string destStrs = "";
|
|||
|
|
private string connstr = "";
|
|||
|
|
private string tablestr;
|
|||
|
|
public LogicCon(EDBItem dbItem, string tablestr)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
this.dbItem = dbItem;
|
|||
|
|
this.tablestr = tablestr;
|
|||
|
|
ConnectStrs(dbItem);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void ConnectStrs(EDBItem dbItem)
|
|||
|
|
{
|
|||
|
|
// dbItem = connstrItem.dbItem;
|
|||
|
|
|
|||
|
|
if (dbItem != null)
|
|||
|
|
{
|
|||
|
|
connstrItem = new StringConnectItem();
|
|||
|
|
connstr = StringConnectItem.InitialStrConn(dbItem);
|
|||
|
|
projDB = DBFactory.CreateAccess(dbItem.DataType);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
throw new Exception("请配置数据库数据!");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public DataTable SelTableData(string tablename,string sql)
|
|||
|
|
{
|
|||
|
|
DataTable dt = new DataTable();
|
|||
|
|
dt = projDB.SelTableData(tablename,connstr,sql );
|
|||
|
|
return dt;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public DataTable DataBase(string sql)
|
|||
|
|
{
|
|||
|
|
DataTable dt = new DataTable();
|
|||
|
|
dt = projDB.DataBase(connstr, sql);
|
|||
|
|
return dt;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|