| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 
 |  
      string connectionString = GetConnectionString();
      OracleConnection connection = new OracleConnection();
      connection.ConnectionString = connectionString;
      connection.Open();
 
      OracleCommand command = connection.CreateCommand();
      string sql = "SELECT label FROM tbl_servers";
      command.CommandText = sql;
      command.CommandType = CommandType.Text;
 
 
      OracleDataReader reader = command.ExecuteReader();
 
      Console.WriteLine("Has rows ? -> "+reader.HasRows);
      // HasRows renvoie toujours false, on ne rentre jamais dans le read.
      while (reader.Read())
      {
        OracleString oraclestring1 = reader.GetOracleString(0);
        Console.WriteLine(oraclestring1.ToString());
      }
      reader.Close();
      connection.Close(); | 
Partager