瀏覽代碼

初始化数据库

lcl 7 月之前
父節點
當前提交
f41d2af354
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Startup.cs

+ 3 - 3
Startup.cs

@@ -140,7 +140,7 @@ namespace MySystem
                     pattern: "{controller=Home}/{action=Index}/{Id?}");
             });
 
-            // initMainServer();
+            initMainServer();
         }
 
         private void initMainServer()
@@ -148,11 +148,11 @@ namespace MySystem
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
             string connstr = Configuration["Setting:SqlConnStr"];
             Library.function.WriteLog(connstr);
-            System.Data.DataTable tablecollection = Library.CustomerSqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'miniprogram_manager'", connstr);
+            System.Data.DataTable tablecollection = Library.CustomerSqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'MiniProgram'", 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 = 'miniprogram_manager' 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 = 'MiniProgram' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'", connstr);
                 foreach (System.Data.DataRow column in columncollection.Rows)
                 {
                     string datatype = column["DATA_TYPE"].ToString();