C#连接Oracle数据库
//1、添加引用 System.data.oracleClient //2、设置连接字符串 data source是服务名(也就是在客户端sqlplus中需要输入的主机字符串) //3、以下用法和sqlserver Access 用法一直 string strConn = "data source=oamis;user=scott;password=tiger;"; OracleConnection conn = new OracleConnection(strConn); conn.Open(); OracleCommand cmd = new OracleCommand(); cmd.CommandText = "select * from emp"; cmd.Connection = conn; DataSet ds = new DataSet(); OracleDataAdapter ad = new OracleDataAdapter(cmd); ad.Fill(ds);