From 79828dea81621fd618d70e5e9dbb327e2271ed5f Mon Sep 17 00:00:00 2001 From: collins-self Date: Tue, 17 Dec 2024 15:22:12 -0500 Subject: [PATCH] OutputStreamDevicePhasor --- .../UI/DataModels/OutputStreamDevicePhasor.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Libraries/GSF.PhasorProtocols/UI/DataModels/OutputStreamDevicePhasor.cs b/Source/Libraries/GSF.PhasorProtocols/UI/DataModels/OutputStreamDevicePhasor.cs index 517759bf98..a3154b0daa 100755 --- a/Source/Libraries/GSF.PhasorProtocols/UI/DataModels/OutputStreamDevicePhasor.cs +++ b/Source/Libraries/GSF.PhasorProtocols/UI/DataModels/OutputStreamDevicePhasor.cs @@ -243,7 +243,7 @@ public static IList LoadKeys(AdoDataConnection database, int outputStreamDe if (!string.IsNullOrEmpty(sortMember)) sortClause = $"ORDER BY {sortMember} {sortDirection}"; - DataTable OutputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, $"SELECT ID FROM OutputStreamDevicePhasor WHERE OutputStreamDeviceID = {outputStreamDeviceID} {sortClause}"); + DataTable OutputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, "SELECT ID FROM OutputStreamDevicePhasor WHERE OutputStreamDeviceID = {0} {1}", outputStreamDeviceID, sortClause); foreach (DataRow row in OutputStreamDevicePhasorTable.Rows) outputStreamDevicePhasorList.Add((row.ConvertField("ID"))); @@ -276,9 +276,8 @@ public static ObservableCollection Load(AdoDataConnect if (keys is not null && keys.Count > 0) { string commaSeparatedKeys = keys.Select(key => $"{key}").Aggregate((str1, str2) => $"{str1},{str2}"); - string query = database.ParameterizedQueryString($"SELECT NodeID, OutputStreamDeviceID, ID, Label, Type, Phase, ScalingValue, LoadOrder FROM OutputStreamDevicePhasor WHERE ID IN ({commaSeparatedKeys})"); - DataTable outputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, query); + DataTable outputStreamDevicePhasorTable = database.Connection.RetrieveData(database.AdapterType, "SELECT NodeID, OutputStreamDeviceID, ID, Label, Type, Phase, ScalingValue, LoadOrder FROM OutputStreamDevicePhasor WHERE ID IN ({0})", commaSeparatedKeys); outputStreamDevicePhasorList = new OutputStreamDevicePhasor[outputStreamDevicePhasorTable.Rows.Count]; foreach (DataRow row in outputStreamDevicePhasorTable.Rows)