【问题标题】:about ODBC connection string using .net关于使用 .net 的 ODBC 连接字符串
【发布时间】:2012-06-08 07:04:34
【问题描述】:

当我连接到 oracle DB 时出现错误。我正在使用使用 ODBC DRIVER 的连接字符串语句。我想从 orcle db 中获取一些数据并将其绑定到某个控件中。我的机器上安装了 oracle 客户端。

my db name is PINDB it's in another server. Not in localhost. 
am creating oracle driver named as obdialer il localhost
local host ip adress is 10.103.1.166
the DB is placed in this server (IP 172.23.6.217)
user id is RAM 
password is RAM 

in my programme am using the connection string as like this.

code
----
conn.ConnectionString = ("Driver ={Microsoft ODBC for Oracle};server=172.23.6.217.PINDB;Uid =OEARENEWAL;Pwd =OEARENEWAL;Persist Security Info=False;Trusted_Connection=Yes")
try
  con.open()
  ----------
  ----------
 catch ex as exception
    msgbox(ex.message)
 end try



i didnt get any error and also the values are not bind to that particular control.
pls help me to correct the error in connectionstring. 

【问题讨论】:

  • 我会从您的连接字符串中删除凭据。
  • 您收到的错误信息是什么?

标签: vb.net odbc


【解决方案1】:

根据this example,您的连接字符串基本正确,但请尝试删除最后两个属性。当您指定用户名和密码时,它不是受信任的连接:

conn.ConnectionString = "Driver={Microsoft ODBC for Oracle};server=172.23.6.217.PINDB;Uid=OEARENEWAL;Pwd=OEARENEWAL"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-21
    相关资源
    最近更新 更多