我想比較兩個查詢結果以查看它們是否相同。如果結果相同,我想顯示一個MessageBox
;如果不做別的。如何比較兩個查詢的結果?
using (OracleCommand crtCommand = new OracleCommand(query1, conn1))
{
string result1 = crtCommand.ExecuteScalar().ToString();
}
using (OracleCommand ctCommand = new OracleCommand("query2", conn1))
{
string result2 = ctCommand.ExecuteScalar().ToString();
}
if (result1 == result2)
MessageBox.Show("They are same");
else
MessageBox.Show("They are not same");
問題是什麼? – SLaks