/// <summary> /// 获取DB选择器 /// </summary> /// <param name="type">数据库类型</param> /// <returns>选择器</returns> public static IDbSelector GetDbSelector(MyDbType type) { IDbSelector selector = null; switch (type) { case MyDbType.None: break; case MyDbType.Oracle: selector = new OracleDbSelector(); break; case MyDbType.MySql: selector = new MySqlDbSelector(); break; case MyDbType.SqlServer: selector = new SqlServerDbSelector(); break; default: break; } return(selector); }
public TableDataRow(MyDbType dbType, string tableName, string[] tableColumnNames, Type[] tableColumnTypes, object[] tableColumnDbTypes, object[] tableValues = null) { this.dbType = dbType; this.tableName = tableName; this.tableColumnNames = tableColumnNames; this.tableColumnTypes = tableColumnTypes; this.tableColumnDbTypes = tableColumnDbTypes; this.tableValues = tableValues; DoConvertToBase64(); }
public static CreateDataSqlDelegate GetCreateSqlFunction(ICreateDataSql obj, MyDbType type) { CreateDataSqlDelegate del = null; IDbSelector selector = GetDbSelector(type); if (selector != null) { del = selector.GetCreateSqlFunction(obj); } return del; }
public static CreateDataSqlDelegate GetCreateSqlFunction(ICreateDataSql obj, MyDbType type) { CreateDataSqlDelegate del = null; IDbSelector selector = GetDbSelector(type); if (selector != null) { del = selector.GetCreateSqlFunction(obj); } return(del); }
public static object GetDbDataType(string strDataType, MyDbType inType, MyDbType outType) { object dbdataType = null; IDbSelector selector = GetDbSelector(inType); if (selector != null) { dbdataType = selector.GetDbDataType(strDataType, outType); } return(dbdataType); }
public static Type GetDbObjectType(Type interfaceType, MyDbType type) { Type objtype = null; IDbSelector selector = GetDbSelector(type); if (selector != null) { objtype = selector.GetDbObjectType(interfaceType); } return(objtype); }
public static IDbClass GetDbClass(string connectstring, MyDbType type) { IDbClass dbClass = null; IDbSelector selector = GetDbSelector(type); if (selector != null) { dbClass = selector.GetDbClass(connectstring); } return(dbClass); }
public string GetConnectString(out MyDbType dbtype) { dbtype = (MyDbType)Enum.Parse(typeof(MyDbType), cbDbType.Text); string temp = ""; if (cbUseConnectStr.Checked) { temp = tbConnectString.Text.Trim(); } else { } return(temp); }
public static IDbConnection GetConnection(MyDbType type, string connStr) { IDbConnection dbConnection = null; if (type == MyDbType.Oracle) { dbConnection = new OracleConnection(connStr); } else if (type == MyDbType.SqlServer) { dbConnection = new SqlConnection(connStr); } return(dbConnection); }
public object GetDbDataType(string strDataType, MyDbType outType) { try { OracleDbType dbtype = OracleDbTypeDics[strDataType.ToUpper()]; if (outType == MyDbType.Oracle) { return(dbtype); } object obj = null; IDbSelector selector = MyDbHelper.GetDbSelector(outType); if (selector != null) { obj = selector.GetDbDataType(dbtype); } return(obj); } catch (Exception ex) { return(null); } }
public DbData(MyDbType dbType, string tableName, string[] tableColumnNames, Type[] tableColumnTypes, object[] tableColumnDbTypes, object[] tableValues = null) { _tableDataRow = new TableDataRow(dbType, tableName, tableColumnNames, tableColumnTypes, tableColumnDbTypes, tableValues); }
public object GetDbDataType(string strDataType, MyDbType outType) { try { OracleDbType dbtype = OracleDbTypeDics[strDataType.ToUpper()]; if (outType == MyDbType.Oracle) { return dbtype; } object obj = null; IDbSelector selector = MyDbHelper.GetDbSelector(outType); if (selector != null) { obj = selector.GetDbDataType(dbtype); } return obj; } catch (Exception ex) { return null; } }
public object GetDbDataType(string strDataType, MyDbType outType) { throw new NotImplementedException(); }
public string GetConnectString(out MyDbType dbtype) { dbtype = (MyDbType)Enum.Parse(typeof(MyDbType), cbDbType.Text); string temp = ""; if (cbUseConnectStr.Checked) { temp = tbConnectString.Text.Trim(); } else { } return temp; }
public void SetDbType(MyDbType type, bool readOnly) { cbDbType.Text = Enum.GetName(typeof(DbTool.DbClasses.MyDbType), type); cbDbType.Refresh(); cbDbType.Enabled = readOnly; }
/// <summary> /// 获取DB选择器 /// </summary> /// <param name="type">数据库类型</param> /// <returns>选择器</returns> public static IDbSelector GetDbSelector(MyDbType type) { IDbSelector selector = null; switch (type) { case MyDbType.None: break; case MyDbType.Oracle: selector = new OracleDbSelector(); break; case MyDbType.MySql: selector = new MySqlDbSelector(); break; case MyDbType.SqlServer: selector = new SqlServerDbSelector(); break; default: break; } return selector; }
public static object GetDbDataType(string strDataType, MyDbType inType, MyDbType outType) { object dbdataType = null; IDbSelector selector = GetDbSelector(inType); if (selector != null) { dbdataType = selector.GetDbDataType(strDataType, outType); } return dbdataType; }
public static IDbClass GetDbClass(string connectstring, MyDbType type) { IDbClass dbClass = null; IDbSelector selector = GetDbSelector(type); if (selector != null) { dbClass = selector.GetDbClass(connectstring); } return dbClass; }
public DbData(MyDbType dbType, string tableName, string[] tableColumnNames, Type[] tableColumnTypes, object[] tableColumnDbTypes, object[] tableValues=null) { _tableDataRow = new TableDataRow(dbType, tableName, tableColumnNames, tableColumnTypes, tableColumnDbTypes, tableValues); }
public static Type GetDbObjectType(Type interfaceType, MyDbType type) { Type objtype = null; IDbSelector selector = GetDbSelector(type); if (selector != null) { objtype = selector.GetDbObjectType(interfaceType); } return objtype; }