Friday, May 30, 2008

Oracle - C#

This is my first step to taste the power of C# with Oracle Database.

OracleConnection connection = new OracleConnection(YourConnection)
OracleCommand command = new OracleCommand(SQL, connection);
connection.Open();
OracleDataReader reader = command.ExecuteReader();
try
{
while (reader.Read())
{
Response.Write((reader.GetValue(0));
}
}
finally
{
reader.Close();
}
}