Browse Source
[5.1] Replace example password with ******** (#3289)
* Replace password with ****
* Replace password with ****
* Replace password with ****
* Replace password with ****
* Replace password with ****
pull/3294/head
David Engel
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
6 additions and
6 deletions
-
doc/samples/SqlConnectionStringBuilder.cs
-
doc/samples/SqlConnectionStringBuilder3.cs
-
doc/samples/SqlConnectionStringBuilder_IntegratedSecurity.cs
-
doc/samples/SqlConnectionStringBuilder_Remove.cs
-
doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml
|
|
@ -21,12 +21,12 @@ class Program |
|
|
|
// connection string, and you can retrieve and
|
|
|
|
// modify any of the elements.
|
|
|
|
builder.ConnectionString = "server=(local);user id=ab;" + |
|
|
|
"password= a!Pass113;initial catalog=AdventureWorks"; |
|
|
|
"password=********;initial catalog=AdventureWorks"; |
|
|
|
|
|
|
|
// Now that the connection string has been parsed,
|
|
|
|
// you can work with individual items.
|
|
|
|
Console.WriteLine(builder.Password); |
|
|
|
builder.Password = "new@1Password"; |
|
|
|
builder.Password = "********"; |
|
|
|
|
|
|
|
// You can refer to connection keys using strings,
|
|
|
|
// as well. When you use this technique (the default
|
|
|
|
|
|
@ -10,7 +10,7 @@ class Program |
|
|
|
try |
|
|
|
{ |
|
|
|
string connectString = |
|
|
|
"Server=(local);Database=AdventureWorks;UID=ab;Pwd= a!Pass@@"; |
|
|
|
"Server=(local);Database=AdventureWorks;UID=ab;Pwd=********"; |
|
|
|
Console.WriteLine("Original: " + connectString); |
|
|
|
SqlConnectionStringBuilder builder = |
|
|
|
new SqlConnectionStringBuilder(connectString); |
|
|
|
|
|
@ -10,7 +10,7 @@ class Program |
|
|
|
try |
|
|
|
{ |
|
|
|
string connectString = |
|
|
|
"Data Source=(local);User ID=ab;Password=MyPassword;" + |
|
|
|
"Data Source=(local);User ID=ab;Password=********;" + |
|
|
|
"Initial Catalog=AdventureWorks"; |
|
|
|
|
|
|
|
SqlConnectionStringBuilder builder = |
|
|
|
|
|
@ -10,7 +10,7 @@ class Program |
|
|
|
try |
|
|
|
{ |
|
|
|
string connectString = |
|
|
|
"Data Source=(local);User ID=ab;Password= a1Pass@@11;" + |
|
|
|
"Data Source=(local);User ID=ab;Password=********;" + |
|
|
|
"Initial Catalog=AdventureWorks"; |
|
|
|
|
|
|
|
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectString); |
|
|
|
|
|
@ -839,7 +839,7 @@ Connections are considered the same if they have the same connection string. Dif |
|
|
|
The example displays the following text in the console window: |
|
|
|
|
|
|
|
``` |
|
|
|
Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password= a1Pass@@11 |
|
|
|
Original: Data Source=(local);Initial Catalog=AdventureWorks;User ID=ab;Password=******** |
|
|
|
Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True |
|
|
|
Database = AdventureWorks |
|
|
|
``` |
|
|
|