gpt4 book ai didi

c# - ODBC 连接字符串

转载 作者:太空狗 更新时间:2023-10-29 18:13:39 26 4
gpt4 key购买 nike

我用 C# 编写了一个程序来使用 OdbcConnection 提取一些数据:

using System.Data.Odbc;
......

OdbcConnection OdbcConn =
new OdbcConnection(Properties.Settings.Default.ConnectionString);
OdbcCommand cmd = new OdbcCommand();

//open connection
if (OdbcConn.State != ConnectionState.Open)
{
OdbcConn.Open();
}

在我的设置文件中,我有这个 ConnectionString:

Dsn=****;uid=userID;pwd=password

但是我无法建立连接。我安装了 IBM 公司的 iseries 访问驱动程序,但如果我尝试 MS 访问,那么我就可以连接。有什么建议吗?

最佳答案

如有疑问(并且涉及连接字符串):http://www.connectionstrings.com/

关于c# - ODBC 连接字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9384311/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com