String ConnectionString = "user id = ordtrc; pwd = ordtrc; data source =" FRAME2DB "; persist security info = False;"; // write a connection string
OracleConnection conn = new OracleConnection (ConnectionString); // create a new connection
Try
{
Conn. Open ();
OracleCommand cmd = conn. CreateCommand ();
Cmd. CommandText = "select * from AUTH_BUSI"; // write an SQL statement here
OracleDataReader odr = cmd. ExecuteReader (); // Create an OracleDateReader object
DataSet ds = new DataSet ();
While (odr. Read () // Read data. If odr. Read () returns false, it indicates the end of the record set.
{
Response. Write (odr. GetOracleString (1). ToString (); // output Field 1. This number is a field index. How to use the field name remains to be studied.
}
Odr. Close ();
}
Catch (Exception ee)
{
Response. Write (ee. Message); // if an error occurs, the error Message is output.
}
Finally
{
Conn. Close (); // Close the connection
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service