gpt4 book ai didi

amazon-redshift - 未找到数据源名称且未指定默认驱动程序(使用 Amazon Redshift (x64))

转载 作者:行者123 更新时间:2023-12-04 18:59:37 25 4
gpt4 key购买 nike

private OdbcConnection _internalConnection;
public OdbcConnection InternalConnection
{
get
{
if (_internalConnection == null)
{
Open();
}
return _internalConnection;
}
}

public void Open()
{
_internalConnection = new OdbcConnection(CreateConnectionString());

try
{
if (_internalConnection.State == System.Data.ConnectionState.Closed)
_internalConnection.Open();
}
catch
{
throw;
}
}

private string CreateConnectionString()
{

int endpointPort = 5439;

string driver = "{Amazon Redshift (x64)}";
string connectionString = "Driver={0};Server={1};Database={2};UID={3};PWD={4};Port={5};SSL=true;Sslmode=Require";

connectionString = string.Format(connectionString,
driver,
Parameters[ConnectionParameterType.DataSource],
Parameters[ConnectionParameterType.DatabaseName],
Parameters[ConnectionParameterType.UserName],
Parameters[ConnectionParameterType.Password],
endpointPort);

return connectionString;
}

see error in image

最佳答案

安装32位驱动

https://s3.amazonaws.com/redshift-downloads/drivers/AmazonRedshiftODBC32-1.3.1.1000.msi

并将字符串驱动程序替换为

string driver = "{Amazon Redshift (x86)}";

关于amazon-redshift - 未找到数据源名称且未指定默认驱动程序(使用 Amazon Redshift (x64)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41036794/

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