lijianhua6120
lijianhua6120
2017-09-14 10:12
采纳率: 0%
浏览 1.2k

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条回答 默认 最新

相关推荐