-3
sorgu.CommandText = "select count(*) from mert";
我想在if語句中用來計算該查詢中的值。並且,我想要訪問該值。我該如何做?if語句中的計數值
代碼:
OracleConnection conn = new OracleConnection(@"DATA SOURCE=;USER ID=orcl2; Password=123");
conn.Open();
OracleCommand sorgu = new OracleCommand();
sorgu.CommandText = "select * from mert";
sorgu.Connection = conn;
OracleDataReader oku = sorgu.ExecuteReader();
while (oku.Read())
{
if (oku[0].ToString() == textBox1.Text && oku[1].ToString() == textBox2.Text)
{
Form2 f = new Form2();
f.ShowDialog();
}
}
oku.Close();
乾杯,
如果僅在Transact SQL中存在。你想要IF/ELSE還是WHERE? – 2011-07-29 12:08:40
@ 0A0D - 我更新了我的問題。 – Selo