连接串如下:
using System.Data.OleDb;
string tempUser="test",tempPassword="000000",tempDataBase="OEMREP",tempServer="192.168.151.102";
string strCon="Provider=OraOLEDB.Oracle;Persist Security Info=False;"+"User ID="+tempUser+";Password="+tempPassword+";Data Source="+tempDataBase+";Server="+tempServer;
OleDbConnection orclConn=new OleDbConnection(strCon);
OleDbDataAdapter oda;
sqlStr = "select table_name,owner from all_tables where owner='SYS' order by table_name";
oda=new OleDbDataAdapter(sqlStr,orclConn);
ds=new DataSet();
oda.Fill(ds);
PS:
在C#中用SYS或System帐号是连不上Oracle的,因为连接串中加不上"as sysdba",这就是微软的失败了。要想连接的话要去Oracle网站子下一个好像是DLP的东东。