diff --git a/docs/architecture/microservices/docker-application-development-process/docker-app-development-workflow.md b/docs/architecture/microservices/docker-application-development-process/docker-app-development-workflow.md index e60195b14406a..41301079a5f69 100644 --- a/docs/architecture/microservices/docker-application-development-process/docker-app-development-workflow.md +++ b/docs/architecture/microservices/docker-application-development-process/docker-app-development-workflow.md @@ -385,7 +385,7 @@ services: - "5433:1433" ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] This docker-compose.yml file is a simplified and merged version. It contains static configuration data for each container (like the name of the custom image), which is always required, and configuration information that might depend on the deployment environment, like the connection string. In later sections, you will learn how to split the docker-compose.yml configuration into multiple docker-compose files and override values depending on the environment and execution type (debug or release). diff --git a/docs/architecture/microservices/implement-resilient-applications/implement-resilient-entity-framework-core-sql-connections.md b/docs/architecture/microservices/implement-resilient-applications/implement-resilient-entity-framework-core-sql-connections.md index 7c026d2bed85e..e24cdeb9421c0 100644 --- a/docs/architecture/microservices/implement-resilient-applications/implement-resilient-entity-framework-core-sql-connections.md +++ b/docs/architecture/microservices/implement-resilient-applications/implement-resilient-entity-framework-core-sql-connections.md @@ -28,7 +28,7 @@ builder.Services.AddDbContext(options => }); ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Execution strategies and explicit transactions using BeginTransaction and multiple DbContexts diff --git a/docs/architecture/microservices/implement-resilient-applications/monitor-app-health.md b/docs/architecture/microservices/implement-resilient-applications/monitor-app-health.md index 667a3a8e28240..9ac267232c224 100644 --- a/docs/architecture/microservices/implement-resilient-applications/monitor-app-health.md +++ b/docs/architecture/microservices/implement-resilient-applications/monitor-app-health.md @@ -97,7 +97,7 @@ public class SqlConnectionHealthCheck : IHealthCheck } ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] Note that in the previous code, `Select 1` is the query used to check the Health of the database. To monitor the availability of your microservices, orchestrators like Kubernetes periodically perform health checks by sending requests to test the microservices. It's important to keep your database queries efficient so that these operations are quick and don’t result in a higher utilization of resources. diff --git a/docs/architecture/microservices/microservice-ddd-cqrs-patterns/nosql-database-persistence-infrastructure.md b/docs/architecture/microservices/microservice-ddd-cqrs-patterns/nosql-database-persistence-infrastructure.md index f136571ab97f3..6d7361aa888cb 100644 --- a/docs/architecture/microservices/microservice-ddd-cqrs-patterns/nosql-database-persistence-infrastructure.md +++ b/docs/architecture/microservices/microservice-ddd-cqrs-patterns/nosql-database-persistence-infrastructure.md @@ -275,7 +275,7 @@ services: - ConnectionString=${ESHOP_AZURE_COSMOSDB:-mongodb://nosqldata} ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] The `ConnectionString` environment variable is resolved this way: If the `ESHOP_AZURE_COSMOSDB` global variable is defined in the `.env` file with the Azure Cosmos DB connection string, it will use it to access the Azure Cosmos DB database in the cloud. If it’s not defined, it will take the `mongodb://nosqldata` value and use the development MongoDB container. diff --git a/docs/architecture/microservices/multi-container-microservice-net-applications/data-driven-crud-microservice.md b/docs/architecture/microservices/multi-container-microservice-net-applications/data-driven-crud-microservice.md index adb51db3ff737..4e33146378605 100644 --- a/docs/architecture/microservices/multi-container-microservice-net-applications/data-driven-crud-microservice.md +++ b/docs/architecture/microservices/multi-container-microservice-net-applications/data-driven-crud-microservice.md @@ -211,7 +211,7 @@ builder.Services.AddDbContext(options => }); ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Additional resources @@ -256,7 +256,7 @@ catalog-api: - "5101:80" ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] The docker-compose.yml files at the solution level are not only more flexible than configuration files at the project or microservice level, but also more secure if you override the environment variables declared at the docker-compose files with values set from your deployment tools, like from Azure DevOps Services Docker deployment tasks. diff --git a/docs/architecture/microservices/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps.md b/docs/architecture/microservices/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps.md index ca09c182c0e72..bd4ecf5a9bd47 100644 --- a/docs/architecture/microservices/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps.md +++ b/docs/architecture/microservices/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps.md @@ -185,7 +185,7 @@ services: - "27017:27017" ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] So, to run the functional/integration tests you must first run this command, from the solution test folder: diff --git a/docs/core/extensions/configuration-providers.md b/docs/core/extensions/configuration-providers.md index 8b3fb07bf498b..f82e2d9560b72 100644 --- a/docs/core/extensions/configuration-providers.md +++ b/docs/core/extensions/configuration-providers.md @@ -228,7 +228,7 @@ When an environment variable is discovered and loaded into configuration with an | `SQLAZURECONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `System.Data.SqlClient` | | `SQLCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:
Value: `System.Data.SqlClient` | -[!INCLUDE [managed-identities](../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../includes/managed-identities.md)] ### Environment variables set in launchSettings.json diff --git a/docs/framework/data/adonet/ado-net-code-examples.md b/docs/framework/data/adonet/ado-net-code-examples.md index 31c1d5ee4c576..3710148ef02b1 100644 --- a/docs/framework/data/adonet/ado-net-code-examples.md +++ b/docs/framework/data/adonet/ado-net-code-examples.md @@ -39,7 +39,7 @@ The following code listings demonstrate how to retrieve data from a database usi The code in this example assumes that you can connect to the `Northwind` sample database on Microsoft SQL Server. The code creates a to select rows from the Products table, adding a to restrict the results to rows with a UnitPrice greater than the specified parameter value, in this case 5. The is opened inside a `using` block, which ensures that resources are closed and disposed when the code exits. The code executes the command by using a , and displays the results in the console window. If you're using `System.Data.SqlClient`, you should consider upgrading to `Microsoft.Data.SqlClient` as it's where future investments and new feature developments are being made. For more information, see [Introducing the new Microsoft.Data.SqlClient](https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient). -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] [!code-csharp[DataWorks SampleApp.SqlClient#1](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SampleApp.SqlClient/CS/source.cs#1)] [!code-vb[DataWorks SampleApp.SqlClient#1](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SampleApp.SqlClient/VB/source.vb#1)] @@ -62,7 +62,7 @@ The code in this example assumes that you can connect to the Microsoft Access No The code in this example assumes a connection to DEMO.CUSTOMER on an Oracle server. You must also add a reference to the System.Data.OracleClient.dll. The code returns the data in an . -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] [!code-csharp[DataWorks SampleApp.Oracle#1](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SampleApp.Oracle/CS/source.cs#1)] [!code-vb[DataWorks SampleApp.Oracle#1](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SampleApp.Oracle/VB/source.vb#1)] diff --git a/docs/framework/data/adonet/asynchronous-programming.md b/docs/framework/data/adonet/asynchronous-programming.md index d7d1bce44343c..4a34f460a4bd5 100644 --- a/docs/framework/data/adonet/asynchronous-programming.md +++ b/docs/framework/data/adonet/asynchronous-programming.md @@ -193,7 +193,7 @@ class A { } ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Use SQL transactions and the new asynchronous feature @@ -322,7 +322,7 @@ class Program { } ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Cancel an asynchronous operation diff --git a/docs/framework/data/adonet/code-access-security.md b/docs/framework/data/adonet/code-access-security.md index 47256fbc28324..e56da94ad3ce7 100644 --- a/docs/framework/data/adonet/code-access-security.md +++ b/docs/framework/data/adonet/code-access-security.md @@ -91,7 +91,7 @@ To determine whether code is authorized to access a resource or perform an opera ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] #### KeyRestrictions syntax @@ -107,7 +107,7 @@ To determine whether code is authorized to access a resource or perform an opera ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] #### KeyRestrictionBehavior with PreventUsage syntax @@ -123,7 +123,7 @@ To determine whether code is authorized to access a resource or perform an opera ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] #### KeyRestrictionBehavior with AllowOnly syntax @@ -147,7 +147,7 @@ To determine whether code is authorized to access a resource or perform an opera ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Enable partial trust with a custom permission set @@ -175,7 +175,7 @@ AllowBlankPassword="False"> ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Verify ADO.NET code access using security permissions @@ -209,7 +209,7 @@ Connection opened, as expected. Failed, as expected: Request failed. ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Interoperability with unmanaged code diff --git a/docs/framework/data/adonet/connection-string-builders.md b/docs/framework/data/adonet/connection-string-builders.md index 8b3f1f6c2024f..9685c8f0f5e85 100644 --- a/docs/framework/data/adonet/connection-string-builders.md +++ b/docs/framework/data/adonet/connection-string-builders.md @@ -42,7 +42,7 @@ builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad"; Console.WriteLine(builder.ConnectionString); ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] The output shows that the handled this correctly by escaping the extra value in double quotation marks instead of appending it to the connection string as a new key/value pair. diff --git a/docs/framework/data/adonet/connection-string-syntax.md b/docs/framework/data/adonet/connection-string-syntax.md index 2d2e872ce39ec..78159bcf5782b 100644 --- a/docs/framework/data/adonet/connection-string-syntax.md +++ b/docs/framework/data/adonet/connection-string-syntax.md @@ -39,7 +39,7 @@ Windows Authentication (sometimes referred to as *integrated security*) can be u > [!NOTE] > `Integrated Security=true` throws an exception when used with the `OleDb` provider. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## SqlClient connection strings @@ -61,7 +61,7 @@ The syntax for a connection string is database=AdventureWorks;server=(local)" ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### SQL Server authentication with SqlClient @@ -76,7 +76,7 @@ When you connect to Azure SQL Database or to Azure SQL Data Warehouse and provid > [!NOTE] > Windows authentication takes precedence over SQL Server logins. If you specify both `Integrated Security=true` as well as a user name and password, the user name and password are ignored and Windows authentication is used. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Connect to a named instance of SQL Server @@ -150,7 +150,7 @@ Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Northwind.mdb;Jet OLEDB:System D > [!IMPORTANT] > It is possible to supply connection information for an **OleDbConnection** in a Universal Data Link (UDL) file; however you should avoid doing so. UDL files are not encrypted, and expose connection string information in clear text. Because a UDL file is an external file-based resource to your application, it cannot be secured using .NET Framework. UDL files are not supported for **SqlClient**. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Use DataDirectory to connect to Access/Jet @@ -183,7 +183,7 @@ Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyExcel.xls;Extended Properties= "Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=(local);Initial Catalog=pubs;Integrated Security=SSPI;" ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Odbc connection strings @@ -205,7 +205,7 @@ Data Source=Oracle9i;User ID=*****;Password=*****; For more information on ODBC connection string syntax, see . -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## See also diff --git a/docs/framework/data/adonet/connection-strings-and-configuration-files.md b/docs/framework/data/adonet/connection-strings-and-configuration-files.md index 5636ab24cc17d..4ed9f8396a444 100644 --- a/docs/framework/data/adonet/connection-strings-and-configuration-files.md +++ b/docs/framework/data/adonet/connection-strings-and-configuration-files.md @@ -10,7 +10,7 @@ dev_langs: Embedding connection strings in your application's code can lead to security vulnerabilities and maintenance problems. Unencrypted connection strings compiled into an application's source code can be viewed using the [Ildasm.exe (IL Disassembler)](../../tools/ildasm-exe-il-disassembler.md) tool. Moreover, if the connection string ever changes, your application must be recompiled. For these reasons, we recommend storing connection strings in an application configuration file. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Application Configuration Files @@ -163,7 +163,7 @@ Embedding connection strings in your application's code can lead to security vul You must add a reference to `System.Configuration.dll` in your project for the code to run. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] [!code-csharp[DataWorks ConnectionStrings.Encrypt#1](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks ConnectionStrings.Encrypt/CS/source.cs#1)] [!code-vb[DataWorks ConnectionStrings.Encrypt#1](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks ConnectionStrings.Encrypt/VB/source.vb#1)] diff --git a/docs/framework/data/adonet/connection-strings.md b/docs/framework/data/adonet/connection-strings.md index cbff23b527053..cff9fbd910d45 100644 --- a/docs/framework/data/adonet/connection-strings.md +++ b/docs/framework/data/adonet/connection-strings.md @@ -54,7 +54,7 @@ Typing mistakes can cause errors. For example, `Integrated Security=true` is val Connection strings constructed manually at run time from unvalidated user input are vulnerable to string-injection attacks and jeopardize security at the data source. To address these problems, *ADO.NET* 2.0 introduced [connection string builders](connection-string-builders.md) for each *.NET Framework* data provider. These connection string builders expose parameters as strongly typed properties and make it possible to validate the connection string before it's sent to the data source. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## In this section diff --git a/docs/framework/data/adonet/obtaining-a-dbproviderfactory.md b/docs/framework/data/adonet/obtaining-a-dbproviderfactory.md index 0895419d491dc..2398fd0cb1aa2 100644 --- a/docs/framework/data/adonet/obtaining-a-dbproviderfactory.md +++ b/docs/framework/data/adonet/obtaining-a-dbproviderfactory.md @@ -77,7 +77,7 @@ The process of obtaining a involves ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Retrieve a Connection String by Provider Name diff --git a/docs/framework/data/adonet/ole-db-odbc-and-oracle-connection-pooling.md b/docs/framework/data/adonet/ole-db-odbc-and-oracle-connection-pooling.md index 213392af78e39..165b2837b1b26 100644 --- a/docs/framework/data/adonet/ole-db-odbc-and-oracle-connection-pooling.md +++ b/docs/framework/data/adonet/ole-db-odbc-and-oracle-connection-pooling.md @@ -15,7 +15,7 @@ The .NET Framework Data Provider for OLE DB automatically pools connections usin Provider=SQLOLEDB;OLE DB Services=-4;Data Source=localhost;Integrated Security=SSPI; ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] We recommend that you always close or dispose of a connection when you're finished using it in order to return the connection to the pool. Connections that aren't explicitly closed might not get returned to the pool. For example, a connection that has gone out of scope but that has not been explicitly closed will only be returned to the connection pool if the maximum pool size is reached and the connection is still valid. diff --git a/docs/framework/data/adonet/performance-counters.md b/docs/framework/data/adonet/performance-counters.md index 17033bbeb0174..af8e5e804e2b2 100644 --- a/docs/framework/data/adonet/performance-counters.md +++ b/docs/framework/data/adonet/performance-counters.md @@ -35,7 +35,7 @@ ADO.NET 2.0 introduced expanded support for performance counters that includes s When using Windows Authentication (integrated security), you must monitor both the `NumberOfActiveConnectionPoolGroups` and `NumberOfActiveConnectionPools` performance counters. The reason is that connection pool groups map to unique connection strings. When integrated security is used, connection pools map to connection strings and additionally create separate pools for individual Windows identities. For example, if Fred and Julie, each within the same AppDomain, both use the connection string `"Data Source=MySqlServer;Integrated Security=true"`, a connection pool group is created for the connection string, and two additional pools are created, one for Fred and one for Julie. If John and Martha use a connection string with an identical SQL Server login, `"Data Source=MySqlServer;User Id=lowPrivUser;Password=[PLACEHOLDER]"`, then only a single pool is created for the **lowPrivUser** identity. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ### Activating Off-By-Default Counters diff --git a/docs/framework/data/adonet/protecting-connection-information.md b/docs/framework/data/adonet/protecting-connection-information.md index 27da1429548c8..11298b81d6b80 100644 --- a/docs/framework/data/adonet/protecting-connection-information.md +++ b/docs/framework/data/adonet/protecting-connection-information.md @@ -9,7 +9,7 @@ Protecting access to your data source is one of the most important goals when se Security vulnerabilities involving connection strings can arise based on the type of authentication used, how connection strings are persisted in memory and on disk, and the techniques used to construct them at run time. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Use Windows Authentication diff --git a/docs/framework/data/adonet/secure-data-access.md b/docs/framework/data/adonet/secure-data-access.md index aefbfd30076e5..80a7fbfbd73e0 100644 --- a/docs/framework/data/adonet/secure-data-access.md +++ b/docs/framework/data/adonet/secure-data-access.md @@ -12,7 +12,7 @@ To write secure ADO.NET code, you have to understand the security mechanisms ava When connecting to Microsoft SQL Server, you can use Windows Authentication, also known as Integrated Security, which uses the identity of the current active Windows user rather than passing a user ID and password. Using Windows Authentication is recommended for on-premises databases because user credentials aren't exposed in the connection string. If you can't use Windows Authentication to connect to SQL Server, then consider creating connection strings at run time using the . -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] The credentials used for authentication need to be handled differently based on the type of application. For example, in a Windows Forms application, the user can be prompted to supply authentication information, or the user's Windows credentials can be used. However, a Web application often accesses data using credentials supplied by the application itself rather than by the user. diff --git a/docs/framework/data/adonet/sql-server-connection-pooling.md b/docs/framework/data/adonet/sql-server-connection-pooling.md index 4806e3c442aa1..67d6ea22af9ca 100644 --- a/docs/framework/data/adonet/sql-server-connection-pooling.md +++ b/docs/framework/data/adonet/sql-server-connection-pooling.md @@ -50,7 +50,7 @@ using (SqlConnection connection = new SqlConnection( } ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] If `Min Pool Size` is either not specified in the connection string or is specified as zero, the connections in the pool will be closed after a period of inactivity. However, if the specified `Min Pool Size` is greater than zero, the connection pool is not destroyed until the `AppDomain` is unloaded and the process ends. Maintenance of inactive or empty pools involves minimal system overhead. diff --git a/docs/framework/data/adonet/sql/sql-server-express-user-instances.md b/docs/framework/data/adonet/sql/sql-server-express-user-instances.md index 76b9f631a6323..55e45d75c2026 100644 --- a/docs/framework/data/adonet/sql/sql-server-express-user-instances.md +++ b/docs/framework/data/adonet/sql/sql-server-express-user-instances.md @@ -54,7 +54,7 @@ In this connection string: > [!NOTE] > You can also use the and properties to build a connection string at run time. -[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../../includes/managed-identities.md)] ### Using the |DataDirectory| Substitution String diff --git a/docs/framework/whats-new/index.md b/docs/framework/whats-new/index.md index 5f010481db383..4ca52c4da823f 100644 --- a/docs/framework/whats-new/index.md +++ b/docs/framework/whats-new/index.md @@ -711,7 +711,7 @@ ASP.NET processes requests in a predefined pipeline that includes 23 events. ASP In .NET Framework 4.7 and earlier versions, ASP.NET allowed developers to store user credentials with hashed passwords in configuration files using either MD5 or SHA1. Starting with .NET Framework 4.7.1, ASP.NET also supports new secure SHA-2 hash options such as SHA256, SHA384, and SHA512. SHA1 remains the default, and a non-default hash algorithm can be defined in the web configuration file. -[!INCLUDE [managed-identities](../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../includes/managed-identities.md)] ## What's new in .NET Framework 4.7 diff --git a/docs/framework/windows-workflow-foundation/how-to-create-and-run-a-long-running-workflow.md b/docs/framework/windows-workflow-foundation/how-to-create-and-run-a-long-running-workflow.md index 687608e4d5e81..26f8050f6008a 100644 --- a/docs/framework/windows-workflow-foundation/how-to-create-and-run-a-long-running-workflow.md +++ b/docs/framework/windows-workflow-foundation/how-to-create-and-run-a-long-running-workflow.md @@ -114,7 +114,7 @@ The steps in this section add properties and helper methods to the form class th 3. Add the following member declarations to the **WorkflowHostForm** class. - [!INCLUDE [managed-identities](../includes/managed-identities.md)] + [!INCLUDE [managed-identities](../../includes/managed-identities.md)] ```vb Const connectionString = "Server=.\SQLEXPRESS;Initial Catalog=WF45GettingStartedTutorial;Integrated Security=SSPI" diff --git a/docs/framework/windows-workflow-foundation/how-to-deserialize-instance-data-properties.md b/docs/framework/windows-workflow-foundation/how-to-deserialize-instance-data-properties.md index c0ec3a1f2d8bd..c97133dbb1063 100644 --- a/docs/framework/windows-workflow-foundation/how-to-deserialize-instance-data-properties.md +++ b/docs/framework/windows-workflow-foundation/how-to-deserialize-instance-data-properties.md @@ -18,7 +18,7 @@ Primitive data properties refer to properties whose .NET types are considered to This example provides code that enables a user to deserialize primitive data properties. Given a byte array read from either the ReadWritePrimitiveDataProperties or WriteOnlyPrimitiveDataProperties column, this code will convert the binary large object (BLOB) into a of type `` where each key-value pair represents a property name and its corresponding value. -[!INCLUDE [managed-identities](../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../includes/managed-identities.md)] ```csharp using System; diff --git a/docs/framework/windows-workflow-foundation/how-to-enable-persistence-for-workflows-and-workflow-services.md b/docs/framework/windows-workflow-foundation/how-to-enable-persistence-for-workflows-and-workflow-services.md index a00399e282606..82ce134065fbb 100644 --- a/docs/framework/windows-workflow-foundation/how-to-enable-persistence-for-workflows-and-workflow-services.md +++ b/docs/framework/windows-workflow-foundation/how-to-enable-persistence-for-workflows-and-workflow-services.md @@ -56,4 +56,4 @@ Persistence can be enabled using an application configuration file by adding the ``` -[!INCLUDE [managed-identities](../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../includes/managed-identities.md)] diff --git a/docs/framework/windows-workflow-foundation/how-to-enable-sql-persistence-for-workflows-and-workflow-services.md b/docs/framework/windows-workflow-foundation/how-to-enable-sql-persistence-for-workflows-and-workflow-services.md index a7cfe2b58f63d..4bd152e7d7032 100644 --- a/docs/framework/windows-workflow-foundation/how-to-enable-sql-persistence-for-workflows-and-workflow-services.md +++ b/docs/framework/windows-workflow-foundation/how-to-enable-sql-persistence-for-workflows-and-workflow-services.md @@ -134,7 +134,7 @@ The `SqlWorkflowInstanceStoreBehavior`, a service behavior that allows you to co ``` -[!INCLUDE [managed-identities](../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../includes/managed-identities.md)] If you do not set values for the `connectionString` or the `connectionStringName` property, the SQL Workflow Instance Store uses the default named connection string `DefaultSqlWorkflowInstanceStoreConnectionString`. diff --git a/docs/framework/windows-workflow-foundation/how-to-update-the-definition-of-a-running-workflow-instance.md b/docs/framework/windows-workflow-foundation/how-to-update-the-definition-of-a-running-workflow-instance.md index f9f79a79ef634..eeb28e46796be 100644 --- a/docs/framework/windows-workflow-foundation/how-to-update-the-definition-of-a-running-workflow-instance.md +++ b/docs/framework/windows-workflow-foundation/how-to-update-the-definition-of-a-running-workflow-instance.md @@ -1125,7 +1125,7 @@ Dynamic update provides a mechanism for workflow application developers to updat const string connectionString = "Server=.\\SQLEXPRESS;Initial Catalog=WF45GettingStartedTutorial;Integrated Security=SSPI"; ``` - [!INCLUDE [managed-identities](../includes/managed-identities.md)] + [!INCLUDE [managed-identities](../../includes/managed-identities.md)] > [!NOTE] > Depending on your edition of SQL Server, the connection string server name might be different. diff --git a/docs/framework/windows-workflow-foundation/samples/database-access-activities.md b/docs/framework/windows-workflow-foundation/samples/database-access-activities.md index fe53af9e81bd0..fe6cb7bf24f09 100644 --- a/docs/framework/windows-workflow-foundation/samples/database-access-activities.md +++ b/docs/framework/windows-workflow-foundation/samples/database-access-activities.md @@ -19,7 +19,7 @@ This class performs its work asynchronously (it derives from : AsyncCodeActivity | Parameters | Collection of the parameters of the SQL query. | | Result | Scalar that is obtained after the query is executed. This argument is of type `TResult`. | -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## DbQuery @@ -135,7 +135,7 @@ Executes a query that retrieves a list of objects. After the query is executed, The connection information can be configured by setting a provider invariant name (`ProviderName`) and the connection string (`ConnectionString`) or just using a connection string configuration name (`ConfigFileSectionName`) from the application configuration file. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] The query to be executed is configured in its `Sql` property and the parameters are passed through the `Parameters` collection. @@ -193,7 +193,7 @@ public class DbQuery : AsyncCodeActivity> where TResult | MapperFunc | Mapping function (<`DbDataReader`, `TResult`>) that takes a record in the `DataReader` obtained as result of executing the query and returns an instance of an object of type `TResult` to be added to the `Result` collection.

In this case, the mapping is done in multiple pulses of execution. This function can be serialized to XAML and authored declaratively (any existing activity can participate in the mapping). | | Result | List of objects obtained as result of executing the query and executing the mapping function for each record in the `DataReader`. | -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## DbQueryDataSet @@ -201,7 +201,7 @@ Executes a query that returns a . This class performs The connection information can be configured by setting a provider invariant name (`ProviderName`) and the connection string (`ConnectionString`) or just using a connection string configuration name (`ConfigFileSectionName`) from the application configuration file. -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] The query to be executed is configured in its `Sql` property and the parameters are passed through the `Parameters` collection. @@ -249,7 +249,7 @@ public class DbQueryDataSet : AsyncCodeActivity | Parameters | Collection of the parameters of the SQL query. | | Result | that is obtained after the query is executed. | -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Configure connection information @@ -288,7 +288,7 @@ All DbActivities share the same configuration parameters. They can be configured }; ``` -[!INCLUDE [managed-identities](../../includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## Run this sample diff --git a/docs/fundamentals/code-analysis/quality-rules/ca2100.md b/docs/fundamentals/code-analysis/quality-rules/ca2100.md index 3861e33b01eca..a96f8645674b6 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca2100.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca2100.md @@ -106,7 +106,7 @@ The following example shows a method, `UnsafeQuery`, that violates the rule. It :::code language="csharp" source="snippets/csharp/all-rules/ca2100.cs" id="snippet1"::: -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] ## See also diff --git a/docs/framework/includes/managed-identities.md b/docs/includes/managed-identities.md similarity index 100% rename from docs/framework/includes/managed-identities.md rename to docs/includes/managed-identities.md diff --git a/docs/machine-learning/how-to-guides/load-data-ml-net.md b/docs/machine-learning/how-to-guides/load-data-ml-net.md index e2e2e0f850496..63c61c3800104 100644 --- a/docs/machine-learning/how-to-guides/load-data-ml-net.md +++ b/docs/machine-learning/how-to-guides/load-data-ml-net.md @@ -143,7 +143,7 @@ DatabaseLoader loader = mlContext.Data.CreateDatabaseLoader(); Define your connection string as well as the SQL command to be executed on the database and create a `DatabaseSource` instance. This sample uses a LocalDB SQL Server database with a file path. However, DatabaseLoader supports any other valid connection string for databases on-premises and in the cloud. -[!INCLUDE [managed-identities](../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../includes/managed-identities.md)] ```csharp string connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=;Database=;Integrated Security=True;Connect Timeout=30"; diff --git a/docs/orleans/grains/grain-persistence/index.md b/docs/orleans/grains/grain-persistence/index.md index c857733d83172..6caeac0b904b8 100644 --- a/docs/orleans/grains/grain-persistence/index.md +++ b/docs/orleans/grains/grain-persistence/index.md @@ -208,7 +208,7 @@ var host = new HostBuilder() .Build(); ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] :::zone-end diff --git a/docs/orleans/host/configuration-guide/configuring-ado-dot-net-providers.md b/docs/orleans/host/configuration-guide/configuring-ado-dot-net-providers.md index 9359cc511334e..b947e59cb6f77 100644 --- a/docs/orleans/host/configuration-guide/configuring-ado-dot-net-providers.md +++ b/docs/orleans/host/configuration-guide/configuring-ado-dot-net-providers.md @@ -60,7 +60,7 @@ siloHostBuilder.UseAdoNetClustering(options => }); ``` -[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] Where the `ConnectionString` is set to a valid AdoNet Server connection string. diff --git a/docs/standard/data/sqlite/connection-strings.md b/docs/standard/data/sqlite/connection-strings.md index 247c357995483..d83b3c93295f9 100644 --- a/docs/standard/data/sqlite/connection-strings.md +++ b/docs/standard/data/sqlite/connection-strings.md @@ -6,9 +6,7 @@ description: The supported keywords and values of connection strings. --- # Connection strings -A connection string is used to specify how to connect to the database. Connection strings in Microsoft.Data.Sqlite -follow the standard [ADO.NET syntax](../../../framework/data/adonet/connection-strings.md) as a semicolon-separated list of -keywords and values. +A connection string is used to specify how to connect to the database. Connection strings in Microsoft.Data.Sqlite follow the standard [ADO.NET syntax](../../../framework/data/adonet/connection-strings.md) as a semicolon-separated list of keywords and values. ## Keywords @@ -114,6 +112,8 @@ You can use as a stro [!code-csharp[](../../../../samples/snippets/standard/data/sqlite/EncryptionSample/Program.cs?name=snippet_ConnectionStringBuilder)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] + ## Examples ### Basic diff --git a/docs/standard/data/sqlite/encryption.md b/docs/standard/data/sqlite/encryption.md index c152f729da5f7..3aa578896ea60 100644 --- a/docs/standard/data/sqlite/encryption.md +++ b/docs/standard/data/sqlite/encryption.md @@ -35,6 +35,8 @@ To enable encryption on a new database, specify the key using the `Password` con [!code-csharp[](../../../../samples/snippets/standard/data/sqlite/EncryptionSample/Program.cs?name=snippet_ConnectionStringBuilder)] +[!INCLUDE [managed-identities](../../../includes/managed-identities.md)] + > [!TIP] > The method for encrypting and decrypting existing databases varies depending on which solution you're using. For example, you need to use the `sqlcipher_export()` function on SQLCipher. Check your solution's documentation for details. diff --git a/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md b/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md index ebb13d5d6b75d..6b6144177956a 100644 --- a/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md +++ b/docs/standard/parallel-programming/walkthrough-using-batchblock-and-batchedjoinblock-to-improve-efficiency.md @@ -20,47 +20,25 @@ The TPL Dataflow Library provides the [!IMPORTANT] > In some versions of Windows, you cannot connect to Northwind.sdf if Visual Studio is running in a non-administrator mode. To connect to Northwind.sdf, start Visual Studio or a Developer Command Prompt for Visual Studio in the **Run as administrator** mode. -This walkthrough contains the following sections: - -- [Creating the Console Application](#creating) - -- [Defining the Employee Class](#employeeClass) - -- [Defining Employee Database Operations](#operations) - -- [Adding Employee Data to the Database without Using Buffering](#nonBuffering) - -- [Using Buffering to Add Employee Data to the Database](#buffering) - -- [Using Buffered Join to Read Employee Data from the Database](#bufferedJoin) - -- [The Complete Example](#complete) - - - ## Creating the Console Application 1. In Visual Studio, create a Visual C# or Visual Basic **Console Application** project. In this document, the project is named `DataflowBatchDatabase`. -2. In your project, add a reference to System.Data.SqlServerCe.dll and a reference to System.Threading.Tasks.Dataflow.dll. - -3. Ensure that Form1.cs (Form1.vb for Visual Basic) contains the following `using` (`Imports` in Visual Basic) statements. +1. Ensure that Form1.cs (Form1.vb for Visual Basic) contains the following `using` (`Imports` in Visual Basic) statements. [!code-csharp[TPLDataflow_BatchDatabase#1](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs#1)] [!code-vb[TPLDataflow_BatchDatabase#1](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb#1)] -4. Add the following data members to the `Program` class. +1. Add the following data members to the `Program` class. [!code-csharp[TPLDataflow_BatchDatabase#2](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs#2)] [!code-vb[TPLDataflow_BatchDatabase#2](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb#2)] - - ## Defining the Employee Class Add to the `Program` class the `Employee` class. @@ -70,8 +48,6 @@ Add to the `Program` class the `Employee` class. The `Employee` class contains three properties, `EmployeeID`, `LastName`, and `FirstName`. These properties correspond to the `Employee ID`, `Last Name`, and `First Name` columns in the `Employees` table in the Northwind database. For this demonstration, the `Employee` class also defines the `Random` method, which creates an `Employee` object that has random values for its properties. - - ## Defining Employee Database Operations Add to the `Program` class the `InsertEmployees`, `GetEmployeeCount`, and `GetEmployeeID` methods. @@ -79,9 +55,7 @@ Add to the `Program` class the `InsertEmployees`, `GetEmployeeCount`, and `GetEm [!code-csharp[TPLDataflow_BatchDatabase#4](../../../samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs#4)] [!code-vb[TPLDataflow_BatchDatabase#4](../../../samples/snippets/visualbasic/VS_Snippets_Misc/tpldataflow_batchdatabase/vb/dataflowbatchdatabase.vb#4)] -The `InsertEmployees` method adds new employee records to the database. The `GetEmployeeCount` method retrieves the number of entries in the `Employees` table. The `GetEmployeeID` method retrieves the identifier of the first employee that has the provided name. Each of these methods takes a connection string to the Northwind database and uses functionality in the `System.Data.SqlServerCe` namespace to communicate with the database. - - +The `InsertEmployees` method adds new employee records to the database. The `GetEmployeeCount` method retrieves the number of entries in the `Employees` table. The `GetEmployeeID` method retrieves the identifier of the first employee that has the provided name. Each of these methods takes a connection string to the Northwind database. ## Adding Employee Data to the Database Without Using Buffering @@ -92,8 +66,6 @@ Add to the `Program` class the `AddEmployees` and `PostRandomEmployees` methods. The `AddEmployees` method adds random employee data to the database by using dataflow. It creates an object that calls the `InsertEmployees` method to add an employee entry to the database. The `AddEmployees` method then calls the `PostRandomEmployees` method to post multiple `Employee` objects to the object. The `AddEmployees` method then waits for all insert operations to finish. - - ## Using Buffering to Add Employee Data to the Database Add to the `Program` class the `AddEmployeesBatched` method. @@ -103,8 +75,6 @@ Add to the `Program` class the `AddEmployeesBatched` method. This method resembles `AddEmployees`, except that it also uses the class to buffer multiple `Employee` objects before it sends those objects to the object. Because the class propagates out multiple elements as a collection, the object is modified to act on an array of `Employee` objects. As in the `AddEmployees` method, `AddEmployeesBatched` calls the `PostRandomEmployees` method to post multiple `Employee` objects; however, `AddEmployeesBatched` posts these objects to the object. The `AddEmployeesBatched` method also waits for all insert operations to finish. - - ## Using Buffered Join to Read Employee Data from the Database Add to the `Program` class the `GetRandomEmployees` method. @@ -114,8 +84,6 @@ Add to the `Program` class the `GetRandomEmployees` method. This method prints information about random employees to the console. It creates several random `Employee` objects and calls the `GetEmployeeID` method to retrieve the unique identifier for each object. Because the `GetEmployeeID` method throws an exception if there is no matching employee with the given first and last names, the `GetRandomEmployees` method uses the class to store `Employee` objects for successful calls to `GetEmployeeID` and objects for calls that fail. The object in this example acts on a object that holds a list of `Employee` objects and a list of objects. The object propagates out this data when the sum of the received `Employee` and object counts equals the batch size. - - ## The Complete Example The following example shows the complete code. The `Main` method compares the time that is required to perform batched database insertions versus the time to perform non-batched database insertions. It also demonstrates the use of buffered join to read employee data from the database and also report errors. diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/App.Config b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/App.Config index caefd4bc550c3..d3dbfef5aa345 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/App.Config +++ b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Conceptual Examples/CS/App.Config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Examples/CS/App.Config b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Examples/CS/App.Config index caefd4bc550c3..d3dbfef5aa345 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Examples/CS/App.Config +++ b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Examples/CS/App.Config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Materialization Example/CS/App.Config b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Materialization Example/CS/App.Config index caefd4bc550c3..d3dbfef5aa345 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DP L2E Materialization Example/CS/App.Config +++ b/samples/snippets/csharp/VS_Snippets_Data/DP L2E Materialization Example/CS/App.Config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs index aaf791ccddf59..004cb576711bd 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs +++ b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/Source.cs @@ -1030,8 +1030,7 @@ static public void ObjectQuery_Context() // Get ObjectContext from ObjectQuery. ObjectContext objectContext = contactQuery.Context; - Console.WriteLine("Connection string {0}", - objectContext.Connection.ConnectionString); + Console.WriteLine($"Connection string {objectContext.Connection.ConnectionString}"); } // } @@ -3256,39 +3255,9 @@ public static void DirectlyExecuteCommandsAgainstStore() public static void TranslateReader() { - // - // Initialize the connection string builder for the - // underlying provider. - SqlConnectionStringBuilder sqlBuilder = - new SqlConnectionStringBuilder(); - - sqlBuilder.DataSource = "."; - sqlBuilder.InitialCatalog = "School"; - sqlBuilder.IntegratedSecurity = true; - - SqlConnection con = new SqlConnection(sqlBuilder.ToString()); - { - con.Open(); - DbCommand cmd = con.CreateCommand(); - cmd.CommandText = @"SELECT * FROM Department"; - - // Create a reader that contains rows of entity data. - using (DbDataReader rdr = cmd.ExecuteReader(CommandBehavior.SequentialAccess)) - { - using (SchoolEntities context = - new SchoolEntities()) - { - // Translate the reader to the objects of the Department type. - foreach (Department d in context.Translate(rdr)) - { - Console.WriteLine("DepartmentID: {0} ", d.DepartmentID); - } - } - } - con.Close(); - } - // + throw new NotImplementedException(); } + public static void ExecuteStoredProc() { Console.WriteLine("Starting method 'ExecuteStoredProc'"); @@ -3557,8 +3526,7 @@ public static void DDLTest() { // // Initialize the connection string. - String connectionString = "metadata=res://*/School.csdl|res://*/School.ssdl|res://*/School.msl;provider=System.Data.SqlClient;" + - "provider connection string=\"Data Source=.;Initial Catalog=School;Integrated Security=True;MultipleActiveResultSets=True\""; + String connectionString = "..."; using (SchoolEntities context = new SchoolEntities(connectionString)) { diff --git a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/app.config b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/app.config index bc5cd770d424d..81941d2fa4ca4 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/DP ObjectServices Concepts/CS/app.config @@ -1,7 +1,7 @@  - - + + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/dp conceptualmodelfunctions/cs/app.config b/samples/snippets/csharp/VS_Snippets_Data/dp conceptualmodelfunctions/cs/app.config index dbdc77719e139..89c1528a8deac 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/dp conceptualmodelfunctions/cs/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/dp conceptualmodelfunctions/cs/app.config @@ -1,6 +1,5 @@  - - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/app.config b/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/app.config index 79eebfc2a75e6..8affc72f99d67 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/app.config @@ -1,7 +1,7 @@  - - + + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/source.cs b/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/source.cs index 470729cfbdfe0..7a0b629e5daeb 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/source.cs +++ b/samples/snippets/csharp/VS_Snippets_Data/dp entityservices concepts/cs/source.cs @@ -1,19 +1,13 @@ // using System; using System.Collections.Generic; -using System.Collections; -using System.Data.Common; using System.Data; -using System.IO; -using System.Data.SqlClient; +using System.Data.Common; using System.Data.EntityClient; using System.Data.Metadata.Edm; // -// using System.Data.Objects; -using System.Data.Objects.DataClasses; -// -using System.Linq; +using System.Data.SqlClient; namespace Microsoft.Samples.Entity { @@ -228,50 +222,7 @@ static public void StoredProcWithEntityCommand() static public void BuildingConnectionStringWithEntityCommand() { - // - - // Specify the provider name, server and database. - string providerName = "System.Data.SqlClient"; - string serverName = "."; - string databaseName = "AdventureWorks"; - - // Initialize the connection string builder for the - // underlying provider. - SqlConnectionStringBuilder sqlBuilder = - new SqlConnectionStringBuilder(); - - // Set the properties for the data source. - sqlBuilder.DataSource = serverName; - sqlBuilder.InitialCatalog = databaseName; - sqlBuilder.IntegratedSecurity = true; - - // Build the SqlConnection connection string. - string providerString = sqlBuilder.ToString(); - - // Initialize the EntityConnectionStringBuilder. - EntityConnectionStringBuilder entityBuilder = - new EntityConnectionStringBuilder(); - - //Set the provider name. - entityBuilder.Provider = providerName; - - // Set the provider-specific connection string. - entityBuilder.ProviderConnectionString = providerString; - - // Set the Metadata location. - entityBuilder.Metadata = @"res://*/AdventureWorksModel.csdl| - res://*/AdventureWorksModel.ssdl| - res://*/AdventureWorksModel.msl"; - Console.WriteLine(entityBuilder.ToString()); - - using (EntityConnection conn = - new EntityConnection(entityBuilder.ToString())) - { - conn.Open(); - Console.WriteLine("Just testing the connection."); - conn.Close(); - } - // + throw new NotImplementedException(); } static public void ParameterizedQueryWithEntityCommand() diff --git a/samples/snippets/csharp/VS_Snippets_Data/dp l2e arraysandlistsinqueries/cs/app.config b/samples/snippets/csharp/VS_Snippets_Data/dp l2e arraysandlistsinqueries/cs/app.config index caefd4bc550c3..d3dbfef5aa345 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/dp l2e arraysandlistsinqueries/cs/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/dp l2e arraysandlistsinqueries/cs/app.config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/dp l2e canonicalandstorefunctions/cs/app.config b/samples/snippets/csharp/VS_Snippets_Data/dp l2e canonicalandstorefunctions/cs/app.config index 6022c64752e39..d3dbfef5aa345 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/dp l2e canonicalandstorefunctions/cs/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/dp l2e canonicalandstorefunctions/cs/app.config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/dp l2e maptodbfunction/cs/app.config b/samples/snippets/csharp/VS_Snippets_Data/dp l2e maptodbfunction/cs/app.config index d2fa1927ae71e..9d6a3e95a0972 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/dp l2e maptodbfunction/cs/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/dp l2e maptodbfunction/cs/app.config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/dp l2e methods on objectcontext/cs/app.config b/samples/snippets/csharp/VS_Snippets_Data/dp l2e methods on objectcontext/cs/app.config index 6022c64752e39..d3dbfef5aa345 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/dp l2e methods on objectcontext/cs/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/dp l2e methods on objectcontext/cs/app.config @@ -1,6 +1,6 @@  - + - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/app.config b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/app.config index 5fe841f16af3b..1f9790c7a6767 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/app.config +++ b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/app.config @@ -4,7 +4,6 @@ - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/northwind.dbml b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/northwind.dbml index 0d399d8c7f29a..c58de4b026656 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/northwind.dbml +++ b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/northwind.dbml @@ -1,5 +1,5 @@  - + @@ -15,4 +15,4 @@
-
\ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.designer.cs b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.designer.cs index af9707f436d89..e07dd0ea36ad3 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.designer.cs +++ b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.designer.cs @@ -26,7 +26,6 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] - [global::System.Configuration.DefaultSettingValueAttribute("Data Source=faisalmosvr1;Initial Catalog=Northwind;Integrated Security=True")] public string NorthwindConnectionString { get { return ((string)(this["NorthwindConnectionString"])); diff --git a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.settings b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.settings index 1cd0cb9246afe..e71144b2ad40b 100644 --- a/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.settings +++ b/samples/snippets/csharp/VS_Snippets_Data/l2s_querycache/cs/properties/settings.settings @@ -3,12 +3,6 @@ - <?xml version="1.0" encoding="utf-16"?> -<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <ConnectionString>Data Source=faisalmosvr1;Initial Catalog=Northwind;Integrated Security=True</ConnectionString> - <ProviderName>System.Data.SqlClient</ProviderName> -</SerializableConnectionString> - Data Source=faisalmosvr1;Initial Catalog=Northwind;Integrated Security=True - \ No newline at end of file + diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/DataFlowBatch.csproj b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/DataFlowBatch.csproj new file mode 100644 index 0000000000000..3cc2349349211 --- /dev/null +++ b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/DataFlowBatch.csproj @@ -0,0 +1,15 @@ + + + + Library + net4.8 + + + + + + + + + + diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs index 5c381bbd34e32..f47cca0cd241e 100644 --- a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs +++ b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/dataflowbatchdatabase.cs @@ -2,7 +2,7 @@ // using System; using System.Collections.Generic; -using System.Data.SqlServerCe; +using System.Data.SqlClient; using System.Diagnostics; using System.IO; using System.Threading.Tasks.Dataflow; @@ -28,7 +28,7 @@ class Program // TODO: Change this value if Northwind.sdf is at a different location // on your computer. static readonly string sourceDatabase = - @"C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples\Northwind.sdf"; + @"C:\...\Northwind.sdf"; // TODO: Change this value if you require a different temporary location. static readonly string scratchDatabase = @@ -73,13 +73,13 @@ public static Employee Random() // Adds new employee records to the database. static void InsertEmployees(Employee[] employees, string connectionString) { - using (SqlCeConnection connection = - new SqlCeConnection(connectionString)) + using (SqlConnection connection = + new SqlConnection(connectionString)) { try { // Create the SQL command. - SqlCeCommand command = new SqlCeCommand( + SqlCommand command = new SqlCommand( "INSERT INTO Employees ([Last Name], [First Name])" + "VALUES (@lastName, @firstName)", connection); @@ -108,10 +108,10 @@ static void InsertEmployees(Employee[] employees, string connectionString) static int GetEmployeeCount(string connectionString) { int result = 0; - using (SqlCeConnection sqlConnection = - new SqlCeConnection(connectionString)) + using (SqlConnection sqlConnection = + new SqlConnection(connectionString)) { - SqlCeCommand sqlCommand = new SqlCeCommand( + SqlCommand sqlCommand = new SqlCommand( "SELECT COUNT(*) FROM Employees", sqlConnection); sqlConnection.Open(); @@ -131,10 +131,10 @@ static int GetEmployeeCount(string connectionString) static int GetEmployeeID(string lastName, string firstName, string connectionString) { - using (SqlCeConnection connection = - new SqlCeConnection(connectionString)) + using (SqlConnection connection = + new SqlConnection(connectionString)) { - SqlCeCommand command = new SqlCeCommand( + SqlCommand command = new SqlCommand( string.Format( "SELECT [Employee ID] FROM Employees " + "WHERE [Last Name] = '{0}' AND [First Name] = '{1}'", @@ -295,8 +295,7 @@ static void Main(string[] args) { // Create a connection string for accessing the database. // The connection string refers to the temporary database location. - string connectionString = string.Format(@"Data Source={0}", - scratchDatabase); + string connectionString = "..."; // Create a Stopwatch object to time database insert operations. Stopwatch stopwatch = new Stopwatch(); diff --git a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/makefile b/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/makefile deleted file mode 100644 index 8dbef01eb27bb..0000000000000 --- a/samples/snippets/csharp/VS_Snippets_Misc/tpldataflow_batchdatabase/cs/makefile +++ /dev/null @@ -1,2 +0,0 @@ -DataflowBatchDatabase.exe : DataflowBatchDatabase.cs - csc.exe /lib:"C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Desktop" /r:System.Threading.Tasks.Dataflow.dll;System.Data.SqlServerCe.dll DataflowBatchDatabase.cs diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/TransactionScope/cs/Project.csproj b/samples/snippets/csharp/VS_Snippets_Remoting/TransactionScope/cs/Project.csproj new file mode 100644 index 0000000000000..d862d90954842 --- /dev/null +++ b/samples/snippets/csharp/VS_Snippets_Remoting/TransactionScope/cs/Project.csproj @@ -0,0 +1,11 @@ + + + + Library + net4.8 + + + + + + diff --git a/samples/snippets/csharp/VS_Snippets_Remoting/TransactionScope/cs/ScopeWithSQL.cs b/samples/snippets/csharp/VS_Snippets_Remoting/TransactionScope/cs/ScopeWithSQL.cs index 21f54069b2227..07b0e1d2cb2ad 100644 --- a/samples/snippets/csharp/VS_Snippets_Remoting/TransactionScope/cs/ScopeWithSQL.cs +++ b/samples/snippets/csharp/VS_Snippets_Remoting/TransactionScope/cs/ScopeWithSQL.cs @@ -93,16 +93,11 @@ static public int CreateTransactionScope( static private string GetSQLConnectionString1() { - // To avoid storing the connection string in your code, - // you can retrieve it from a configuration file. - return "Integrated Security=true;database=Northwind;server=(local)"; + throw new NotImplementedException(); } static private string GetSQLConnectionString2() { - // To avoid storing the connection string in your code, - // you can retrieve it from a configuration file. - return "Data Source=(local);Initial Catalog=AdventureWorks;" - + "Integrated Security=true"; + throw new NotImplementedException(); } } diff --git a/samples/snippets/standard/data/sqlite/DirtyReadSample/Program.cs b/samples/snippets/standard/data/sqlite/DirtyReadSample/Program.cs index 71675e4654e78..7fa8049c5339d 100644 --- a/samples/snippets/standard/data/sqlite/DirtyReadSample/Program.cs +++ b/samples/snippets/standard/data/sqlite/DirtyReadSample/Program.cs @@ -9,7 +9,7 @@ class Program static void Main() { // The connections must use a shared cache - const string connectionString = "Data Source=DirtyReadSample;Mode=Memory;Cache=Shared"; + const string connectionString = "..."; var firstConnection = new SqliteConnection(connectionString); firstConnection.Open(); diff --git a/samples/snippets/standard/data/sqlite/EncryptionSample/Program.cs b/samples/snippets/standard/data/sqlite/EncryptionSample/Program.cs index 4d349c18be471..b4c2edc3708b4 100644 --- a/samples/snippets/standard/data/sqlite/EncryptionSample/Program.cs +++ b/samples/snippets/standard/data/sqlite/EncryptionSample/Program.cs @@ -11,13 +11,13 @@ class Program static void Main() { const string baseConnectionString = "Data Source=EncryptionSample.db"; - var password = "password"; + var password = "..."; // Notice which packages are referenced by this project: // - Microsoft.Data.Sqlite.Core // - SQLitePCLRaw.bundle_sqlcipher - // The Password keyword in the connection string specifies the encryption key + // The Password keyword in the connection string specifies the encryption key. #region snippet_ConnectionStringBuilder var connectionString = new SqliteConnectionStringBuilder(baseConnectionString) { @@ -28,7 +28,7 @@ static void Main() using (var connection = new SqliteConnection(connectionString)) { - // When a new database is created, it will be encrypted using the key + // When a new database is created, it will be encrypted using the key. connection.Open(); var command = connection.CreateCommand();