C#????orcale
???????????? ???????[ 2013/11/15 11:08:29 ] ????????
//???:??????????:
//???->???????->.NET->System.Data.OracleClient.dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OracleClient;
using System.Data;
namespace LinkOrcale
{
class Program
{
static void Main(string[] args)
{
string ConnectionString="Data Source=orcl;user=scott;password=Admin518;";//д?????
OracleConnection conn=new OracleConnection(ConnectionString);//?????????????
try
{
conn.Open();
OracleCommand cmd=conn.CreateCommand();
cmd.CommandText="select * from emp";//?????дsql???
OracleDataReader odr=cmd.ExecuteReader();//???????OracleDateReader????
while(odr.Read())//???????????odr.Read()?????false?????????????????β????
{
Console.WriteLine(odr.GetOracleNumber(0) + " " + odr.GetOracleString(1).ToString() + " " + odr.GetOracleString(2).ToString() + " " + odr.GetOracleNumber(3) + " "+odr.GetOracleDateTime(4));
//??????1??????????????????
}
odr.Close();
}
catch(Exception e)
{
Console.WriteLine("??????"+e.GetBaseException());
}
finally
{
conn.Close(); //???????
}
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11