連接串如下:
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的東東。