Skip to content

Commit 79828de

Browse files
committed
OutputStreamDevicePhasor
1 parent 3734293 commit 79828de

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Source/Libraries/GSF.PhasorProtocols/UI/DataModels/OutputStreamDevicePhasor.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public static IList<int> LoadKeys(AdoDataConnection database, int outputStreamDe
243243
if (!string.IsNullOrEmpty(sortMember))
244244
sortClause = $"ORDER BY {sortMember} {sortDirection}";
245245

246-
DataTable OutputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, $"SELECT ID FROM OutputStreamDevicePhasor WHERE OutputStreamDeviceID = {outputStreamDeviceID} {sortClause}");
246+
DataTable OutputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, "SELECT ID FROM OutputStreamDevicePhasor WHERE OutputStreamDeviceID = {0} {1}", outputStreamDeviceID, sortClause);
247247

248248
foreach (DataRow row in OutputStreamDevicePhasorTable.Rows)
249249
outputStreamDevicePhasorList.Add((row.ConvertField<int>("ID")));
@@ -276,9 +276,8 @@ public static ObservableCollection<OutputStreamDevicePhasor> Load(AdoDataConnect
276276
if (keys is not null && keys.Count > 0)
277277
{
278278
string commaSeparatedKeys = keys.Select(key => $"{key}").Aggregate((str1, str2) => $"{str1},{str2}");
279-
string query = database.ParameterizedQueryString($"SELECT NodeID, OutputStreamDeviceID, ID, Label, Type, Phase, ScalingValue, LoadOrder FROM OutputStreamDevicePhasor WHERE ID IN ({commaSeparatedKeys})");
280279

281-
DataTable outputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, query);
280+
DataTable outputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, "SELECT NodeID, OutputStreamDeviceID, ID, Label, Type, Phase, ScalingValue, LoadOrder FROM OutputStreamDevicePhasor WHERE ID IN ({0})", commaSeparatedKeys);
282281
outputStreamDevicePhasorList = new OutputStreamDevicePhasor[outputStreamDevicePhasorTable.Rows.Count];
283282

284283
foreach (DataRow row in outputStreamDevicePhasorTable.Rows)

0 commit comments

Comments
 (0)