Browse Source

Apewer-6.5.5

dev
王厅 4 years ago
parent
commit
06ce72b3da
  1. 20
      Apewer.Source/Source/SqlClient.cs
  2. 3
      ChangeLog.md

20
Apewer.Source/Source/SqlClient.cs

@ -217,25 +217,27 @@ namespace Apewer.Source
try try
{ {
using (var adapter = new SqlDataAdapter()) using (var command = new SqlCommand())
{ {
var command = adapter.SelectCommand;
command.Connection = _db; command.Connection = _db;
command.CommandTimeout = _timeout.Query; command.CommandTimeout = _timeout.Query;
command.CommandText = sql; command.CommandText = sql;
if (parameters != null) if (parameters != null)
{ {
foreach (var parameter in parameters) foreach (var p in parameters)
{ {
if (parameter != null) command.Parameters.Add(parameter); if (p != null) command.Parameters.Add(p);
} }
} }
using (var ds = new DataSet()) using (var dataset = new DataSet())
{ {
var srcTable = "table_" + Guid.NewGuid().ToString("n"); using (var da = new SqlDataAdapter(command))
adapter.Fill(ds, srcTable); {
var table = ds.Tables[srcTable]; var name = "table_" + Guid.NewGuid().ToString("n");
return new Query(table, true); da.Fill(dataset, name);
var table = dataset.Tables[name];
return new Query(table);
}
} }
} }
} }

3
ChangeLog.md

@ -1,6 +1,9 @@
 
### 最新提交 ### 最新提交
### 6.5.5
- Source:调整了 SqlClient 的查询超时设置。
### 6.5.4 ### 6.5.4
- Source:调整了 SqlClient 的查询超时设置。 - Source:调整了 SqlClient 的查询超时设置。

Loading…
Cancel
Save