2 lijianhua6120 lijianhua6120 于 2017.09.14 18:12 提问

vb.net 连接服务器上的oracle数据库时报“ORA-12541:TNS:无监听程序”的错误

vb.net 在连接服务器上的oracle数据库时报“ORA-12541:TNS:无监听程序”的错误,代码如下

Imports Oracle.ManagedDataAccess.Client

Dim strConnect As String = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.105)(PORT=1531))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME = inmind.fls)));User Id=inplan;Password=inplan;"
Dim LoginSQL As String = "Select Case OA_ACCOUNT,PASS_WORD,SITE from ENGINEERMANAGER.Operator WHERE OA_ACCOUNT='" & UserName & "' and PASS_WORD='" & PassWord & "'"
Dim JOB_TitleSQL As String = "Select Case OA_ACCOUNT,PASS_WORD,SITE,JOB_TITLE from ENGINEERMANAGER.Operator WHERE OA_ACCOUNT='" & UserName & "' and PASS_WORD='" & PassWord & "' and JOB_TITLE like '%MI进度管理员%"
Dim dataSetJob As DataSet = New DataSet()
Dim dataTableInplan As DataTable = dataSetJob.Tables.Add("Inplan")
Dim BindingSourceJob As New BindingSource
        Dim jobAdapter As New OracleDataAdapter(LoginSQL, strConnect)
        dataTableInplan.Clear()
        jobAdapter.Fill(dataTableInplan)‘这一步报错
        MsgBox(dataTableInplan.Rows.Count)

但是用Oracle SQL Developer可以查到该数据库中的数据。请大神帮忙

1个回答

caozhy
caozhy   Ds   Rxr 2017.09.15 00:07
lijianhua6120
lijianhua6120 我电脑上用的是instantclient 11 1 这个客户端,只是设置了PATH环境变量和tnsnames,没看到Oracle Net Configuration Assistance这个设置在哪里
2 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片