I try to use connectionstring connect to netezza but can't truncate table

425 views Asked by At

I try to connect netezza by use connectionString in following

<add name="cn" connectionString="Data Source=10.209.46.210:5480;User ID=kbanke2e;Initial Catalog=EDW" providerName="NZOLEDB"/>

and want to truncate table in database and got follwing message

A network-related or instance-specific error occurred while establishing a
connection to SQL Server. The server was not found or was not accessible. Verify
that the instance name is correct and that SQL Server is configured to allow 
remote connections. (provider: SQL Network Interfaces, error: 25 - Connection 
string is not valid)

but when I configure connection with server explorer visual studio can connect database

please help me with this question

1

There are 1 answers

0
Ardeth On

Sittipat Chamnongsilp;

Try this sting to connect to your database.

VB.NET

Dim constr As String = "server=(server_IP);Database=(database_name);Uid=(db_user_name);Pwd=(db_password)"

Dim con As New MySqlConnection(constr)

C#

string constr = "server=(server_IP);Database=(database_name);Uid=(db_user_name);Pwd=(db_password)";

MySqlConnection con = new MySqlConnection(constr);