sorgu.CommandText = "select count(*) from mert";
I want to use within if statement to count value in that query.And,I want to access to that value.How can I do that?
Code:
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();
Cheers,
I have never used an Oracle database before, but per MSDN this is how you need to interact with your data:
So, for each column, you have to setup an
OracleString,OracleNumber,OracleDateTime,OracleBinary, etc. The corresponding functions (e.g.GetOracleString(col)) is how you actually retrieve the data.