if deleteRMS const String strQuery SELECT PS2 PARAMETER_SETTING_ID FRO

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
if (deleteRMS)
{
const String strQuery = @"SELECT PS2.PARAMETER_SETTING_ID FROM
TPARAMETER_SETTINGS(NOLOCK) PS1
INNER JOIN TPARAMS_IN_MM_LINKS(NOLOCK) PL ON PL.SRC_PARAMETER_SETTING_ID = PS1.PARAMETER_SETTING_ID
INNER JOIN TPARAMETER_SETTINGS(NOLOCK) PS2 ON PS2.PARAMETER_SETTING_ID = PL.DST_PARAMETER_SETTING_ID
WHERE
PS1.PARAMETER_SETTING_ID = @PARAMETER_ID
AND PS2.VALUE_TYPE_ID = 1";
SqlCommand commandDelete = null;
try
{
commandDelete = new SqlCommand(strQuery, m_SQLConnection, m_Transaction);
commandDelete.CommandTimeout = 0;
SqlDataAdapter adapterDelete = new SqlDataAdapter(commandDelete);
DataSet dataSetDelete = new DataSet();
adapterDelete.Fill(dataSetDelete);
DataTable tableDelete = dataSetDelete.Tables[0];
foreach (DataRow rowDelete in tableDelete.Rows)
{
Guid parameterID = new Guid(rowDelete[0].ToString());
DeleteMeasurementData(Guid.Empty, Guid.Empty, parameterID);
}
}
finally
{
if (commandDelete != null) commandDelete.Dispose();
}
}