.NET Provider TdConnectionStringBuilder help

Connectivity

.NET Provider TdConnectionStringBuilder help

I am having problems getting the TdConnectionStringBuilder in the .NET Data Provider to work.

Here is my code that does not work:

TdConnectionStringBuilder stringBuilder = new TdConnectionStringBuilder();

stringBuilder.AccountString = accountString;
stringBuilder.DataSource = connect.DataSource;
stringBuilder.Database = connect.Database;
stringBuilder.UserId = username;
stringBuilder.Password = password;

connect.ConnectionString = stringBuilder.ConnectionString;
connect.Open();


The reason that it does not work is because it loses the password. The reason I know this is because I can use this line and it will work:

connect.ConnectionString = stringBuilder.ConnectionString + ";Password=" + password;
connect.Open();

Has anyone had this problem using the .NET Data Provider? Could this be a bug or is it something that I am missing?
2 REPLIES
Teradata Employee

Re: .NET Provider TdConnectionStringBuilder help

Please set TdConnectionStringBuilder.PersistSecurityInfo property to true.
Release 1 required this property to be set to true before it would persist the password to the Connection String.

This requirement is removed in Release 2.

Re: .NET Provider TdConnectionStringBuilder help

Thank you Shaw! That worked perfectly.