.NET Provider TdConnectionStringBuilder help


.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;

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;

Has anyone had this problem using the .NET Data Provider? Could this be a bug or is it something that I am missing?
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.