使用asp.net代码连接oracle 10g企业会给tns 1带来错误

时间:2013-04-22 07:17:50

标签: asp.net oracle

我正在使用此代码访问远程服务器的oracle db,但无法连接

OleDbConnection oCon = new OleDbConnection();
oCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=FAIMS_DEV;Password=FAIMS_DEV;Data source=FAIMSDEV;";
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM TAB", oCon);

//OleDbDataAdapter da = new OleDbDataAdapter("SELECT COMP_CODE, CATEGORY_GRP_CODE, CATEGORY_CODE, BRIEF_DESC_ENG, SYSDATE, 'MIS_USER' FROM ICSPCT", oCon);
DataTable dt = new DataTable();
da.Fill(dt);

1 个答案:

答案 0 :(得分:0)

您的连接字符串看起来像是MS Access。如果您尝试连接到Oracle,则可能需要获取Oracle library

要连接到Oracle示例,请查看以下问题:Connect to Oracle without tnsname.ora