From 9ee2abf3f34b3e6c0d35df6cdde0c4d4e1a5d246 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期五, 31 十二月 2021 20:16:08 +0800
Subject: [PATCH] 问题处理

---
 WebSRM/App_Data/MssqlReportData.cs |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/WebSRM/App_Data/MssqlReportData.cs b/WebSRM/App_Data/MssqlReportData.cs
index 41e34c9..9b2b746 100644
--- a/WebSRM/App_Data/MssqlReportData.cs
+++ b/WebSRM/App_Data/MssqlReportData.cs
@@ -14,9 +14,11 @@
     //杩炴帴SQL Server鏁版嵁搴撶殑杩炴帴涓诧紝搴旇淇敼涓轰笌瀹為檯涓�鑷淬�傚鏋滄槸杩愯Grid++Report鏈韩鐨勪緥瀛愶紝搴旇棣栧厛闄勫姞渚嬪瓙鏁版嵁搴撳埌
     //SQL Server2000/2005鏁版嵁搴撲笂銆�
     //public const string SqlConnStr = "Data Source=(local);Initial Catalog=gridreport;Persist Security Info=True;User ID=sa;Password=;";
-    // public const string SqlConnStr = "Data Source=47.96.97.237,15127;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";
+    //public const string SqlConnStr = "Data Source=47.96.97.237,15127;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";
     //澶忓疂
-    public const string SqlConnStr = "Data Source=192.168.1.239;Initial Catalog=HX_LimsSys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";
+    public const string SqlConnStr = "Data Source=192.168.1.239;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";
+    //瀹夌憺
+    //public const string SqlConnStr = "Data Source=.;Initial Catalog=HX_LimsSys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";
 
     //public string sServer;
     //public string sDataBase;
@@ -72,12 +74,37 @@
     //鏍规嵁鏌ヨSQL,浜х敓鎻愪緵缁欐姤琛ㄧ敓鎴愰渶瑕佺殑 XML 鎴� JSON 鏁版嵁
     protected static void DoGenDetailData(System.Web.UI.Page DataPage, string QuerySQL, ResponseDataType DataType, bool IsJSON)
     {
+        LogService.Write(QuerySQL);
+        //SqlConnection conn = new SqlConnection(SqlConnStr);
+        //try
+        //{
+        //    conn.Open();
+        //    LogService.Write("Connection opened.");
+        //    LogService.Write("Connection Properties:");
+        //    LogService.Write("Connection String:{0}", conn.ConnectionString);
+        //    LogService.Write("Database:{0}", conn.Database);
+        //    LogService.Write("DataSource:{0}", conn.DataSource);
+        //    LogService.Write("ServerVersion:{0}", conn.ServerVersion);
+        //    LogService.Write("State:{0}", conn.State.ToString());
+        //    LogService.Write("WorkstationId:{0}", conn.WorkstationId);
+        //}
+        //catch (SqlException e)
+        //{
+        //    LogService.Write("Error: " + e);
+        //}
+        //finally
+        //{
+        //    conn.Close();
+        //    LogService.Write("Connection close.");
+        //}
         SqlConnection ReportConn = new SqlConnection(SqlConnStr);
         SqlDataAdapter ReportDataAdapter = new SqlDataAdapter(QuerySQL, ReportConn);
         DataSet ReportDataSet = new DataSet();
         ReportConn.Open();
+        LogService.Write("State:" + ReportConn.State);
         ReportDataAdapter.Fill(ReportDataSet);
         ReportConn.Close();
+        LogService.Write("hangshu :" + ReportDataSet.Tables[0].Rows.Count);
 
         if (IsJSON)
             JSONReportData.GenDataSet(DataPage, ReportDataSet, DataType);

--
Gitblit v1.9.1