Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SqlConnectionStringBuilder and Trusted_Connection
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01438875
Message ID:
01438881
Vues:
32
>Hi,
>
>I have been trying to add a code to "insert" the setting/string "Trusted_Connection=true" into connection string created
>with the class SqlConnectionStringBuilder but to no avail.
>
>Here is an example of code:
>
>
>SqlConnectionStringBuilder oStringBuilder = new SqlConnectionStringBuilder();
>            oStringBuilder.UserID = "My ID";
>            oStringBuilder.Password = "MyPassword";
>            oStringBuilder.InitialCatalog = "MyDbName";
>
>
>But when I press a dot/period after oStringBuilder the intellisense does no show property for Trusted_Connection.
>
>I read an article on MSDN that a string can be added as following:
>
>
>      oStringBuilder["Trusted_Connection"] = true;
>
>
>But the above line does not add Trusted_Connection to the connection string. However if I add a line:
>
>
>      oStringBuilder["Connect Timeout"] = 20;
>
>
>the value of Connect Timeout=20 is added to the connection string.
>
>Has anybody run into this issue?

UPDATE: I think - maybe - IntegratedSecurity setting (true or false) is actually what this class uses as Trusted_Connection setting. But I will have to test it. Confirmed.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform