Skip to content

Commit

Permalink
OutputStreamDevicePhasor
Browse files Browse the repository at this point in the history
  • Loading branch information
collins-self committed Dec 17, 2024
1 parent 3734293 commit 79828de
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static IList<int> 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<int>("ID")));
Expand Down Expand Up @@ -276,9 +276,8 @@ public static ObservableCollection<OutputStreamDevicePhasor> 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)
Expand Down

0 comments on commit 79828de

Please sign in to comment.