//去重操作
columnList = columnList.GroupBy(p => p.ColumnName).Select(g => g.First()).ToList();
| | |
| | | <connectionStrings> |
| | | <add name="æ¬å°_MySql_CMS" connectionString="Server=localhost;Database=07a6b2f4bbb04e8bb23a9f17a4a769c2_project;Uid=root;Pwd=123abc.com;" /> |
| | | <add name="ZS_æ¬å°WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" /> |
| | | <add name="LA22012_æ¦æ±ç§é_ç产åº_伿¬ç¯å¢" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=123abc.com" /> |
| | | <add name="Shao_æ¬å°WmsMysql" connectionString="Server=localhost;Database=cms.plugin.hiawms;Uid=root;Pwd=123abc.com;" /> |
| | | <!-- <add name="LA22012_æ¦æ±ç§é_ç产åº_伿¬ç¯å¢" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=123abc.com" /> |
| | | <add name="LA22012_æ¦æ±ç§é_ç产åº_26æµè¯ç¯å¢" connectionString="Data Source=172.27.96.26;Initial Catalog=WHMY_Prod_Test;Persist Security Info=True;User ID=sa;Password=MJC!2022@wms" /> |
| | | <add name="LA22012_æ¦æ±ç§é_å¤ä»¶åº_伿¬ç¯å¢" connectionString="Data Source=10.10.40.166;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=123abc.com" /> |
| | | <add name="LA22012_æ¦æ±ç§é_å¤ä»¶åº_26æµè¯ç¯å¢" connectionString="Data Source=172.27.96.26;Initial Catalog=WHMY_Admin.NET;Persist Security Info=True;User ID=sa;Password=MJC!2022@wms" /> |
| | |
| | | <add name="LA18032_AoSinWms_äº" connectionString="Data Source=120.53.244.200;Initial Catalog=LA18032_AoSinWms;Persist Security Info=True;User ID=sa;Password=123abc.com" /> |
| | | <add name="GSiemens_LES" connectionString="Data Source=localhost;Initial Catalog=GSiemens_LES;Persist Security Info=True;User ID=sa;Password=123abc.com" /> |
| | | <add name="GSiemens_WIP" connectionString="Data Source=.;Initial Catalog=GSiemens_WIP;Persist Security Info=True;User ID=sa;Password=123abc.com" /> |
| | | <add name="LocalhostConn" connectionString="Data Source=shaocx;Initial Catalog=SOADB;User ID=sa;Password=1111" /> |
| | | <add name="LocalhostConn" connectionString="Data Source=shaocx;Initial Catalog=SOADB;User ID=sa;Password=1111" /> --> |
| | | </connectionStrings> |
| | | <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup> |
| | | <runtime> |
| | |
| | | //string strSql = $"SELECT COLUMN_NAME as ColumnName, COLUMN_TYPE as DataType, IS_NULLABLE as IsNullable, CHARACTER_MAXIMUM_LENGTH as DataLength,COLUMN_COMMENT as Description " + |
| | | // $"FROM INFORMATION_SCHEMA.COLUMNS " + |
| | | // $"WHERE TABLE_NAME = '{tableName}'"; |
| | | string strSql = $"SELECT DISTINCT c.COLUMN_NAME as ColumnName, c.DATA_TYPE as DataType, c.IS_NULLABLE as IsNullable, c.CHARACTER_MAXIMUM_LENGTH as DataLength, c.COLUMN_COMMENT as Description,c.NUMERIC_SCALE as MyPrecision, " + |
| | | string strSql = $"SELECT c.COLUMN_NAME as ColumnName, c.DATA_TYPE as DataType, c.IS_NULLABLE as IsNullable, c.CHARACTER_MAXIMUM_LENGTH as DataLength, c.COLUMN_COMMENT as Description,c.NUMERIC_SCALE as MyPrecision, " + |
| | | $"CASE WHEN kcu.COLUMN_NAME IS NOT NULL THEN 'true' ELSE 'false' END AS IsPrimaryKey " + |
| | | $"FROM INFORMATION_SCHEMA.COLUMNS c " + |
| | | $"LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu " + |
| | |
| | | { |
| | | DataSet ds = MySqlHelper.Query(connStr, strSql); |
| | | columnList = DataTableToList(ds.Tables[0]); |
| | | //å»éæä½ |
| | | columnList = columnList.GroupBy(p => p.ColumnName).Select(g => g.First()).ToList(); |
| | | } |
| | | catch |
| | | { |