|
|
@@ -140,11 +140,16 @@ namespace MySystem
|
|
|
{
|
|
|
Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
|
|
|
string connstr = Configuration["Setting:KxsSqlConnStr"];
|
|
|
- System.Data.DataTable tablecollection = Library.CustomerSqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsSqlConnStr'", connstr);
|
|
|
+ string dbName = "KxsMainServer";
|
|
|
+ if(Library.ConfigurationManager.EnvironmentFlag == 2)
|
|
|
+ {
|
|
|
+ dbName = "KxsProfitServer";
|
|
|
+ }
|
|
|
+ System.Data.DataTable tablecollection = Library.CustomerSqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = '" + dbName + "'", connstr);
|
|
|
foreach (System.Data.DataRow subtable in tablecollection.Rows)
|
|
|
{
|
|
|
Dictionary<string, string> Columns = new Dictionary<string, string>();
|
|
|
- System.Data.DataTable columncollection = Library.CustomerSqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsSqlConnStr' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'", connstr);
|
|
|
+ System.Data.DataTable columncollection = Library.CustomerSqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = '" + dbName + "' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'", connstr);
|
|
|
foreach (System.Data.DataRow column in columncollection.Rows)
|
|
|
{
|
|
|
string datatype = column["DATA_TYPE"].ToString();
|