diff --git a/Apewer.Source/Source/SqlClient.cs b/Apewer.Source/Source/SqlClient.cs index 2567f29..9a9a81a 100644 --- a/Apewer.Source/Source/SqlClient.cs +++ b/Apewer.Source/Source/SqlClient.cs @@ -217,25 +217,27 @@ namespace Apewer.Source try { - using (var adapter = new SqlDataAdapter()) + using (var command = new SqlCommand()) { - var command = adapter.SelectCommand; command.Connection = _db; command.CommandTimeout = _timeout.Query; command.CommandText = sql; 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"); - adapter.Fill(ds, srcTable); - var table = ds.Tables[srcTable]; - return new Query(table, true); + using (var da = new SqlDataAdapter(command)) + { + var name = "table_" + Guid.NewGuid().ToString("n"); + da.Fill(dataset, name); + var table = dataset.Tables[name]; + return new Query(table); + } } } } diff --git a/ChangeLog.md b/ChangeLog.md index ff69f2d..e584b60 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,9 @@  ### 最新提交 +### 6.5.5 +- Source:调整了 SqlClient 的查询超时设置。 + ### 6.5.4 - Source:调整了 SqlClient 的查询超时设置。