Skip to content

Commit c938c12

Browse files
authored
Merge pull request #18165 from MicrosoftDocs/master
12/24 PM Publish
2 parents d8a9ad8 + ceed4da commit c938c12

36 files changed

Lines changed: 230 additions & 98 deletions

docs/connect/ado-net/commands-parameters.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Commands and Parameters"
2+
title: "Commands and parameters"
33
description: Learn how to use Command objects for Microsoft SqlClient Data Provider for SQL Server to run commands and return results from a data source.
44
ms.date: "11/25/2020"
55
ms.assetid: b623f810-d871-49a5-b0f5-078cc3c34db6
@@ -40,5 +40,6 @@ Describes how to use the Microsoft SqlClient data provider for SQL Server to exe
4040

4141
## See also
4242

43+
- [DataAdapters and DataReaders](dataadapters-datareaders.md)
4344
- [Connecting to a data source](connecting-to-data-source.md)
4445
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

docs/connect/ado-net/common-schema-collections.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ This schema collection exposes information about the words that are reserved by
106106

107107
## See also
108108

109-
- [Retrieving Database Schema Information](retrieving-database-schema-information.md)
110-
- [GetSchema and Schema Collections](getschema-and-schema-collections.md)
109+
- [Retrieving database schema information](retrieving-database-schema-information.md)
110+
- [GetSchema and schema collections](getschema-and-schema-collections.md)
111111
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

docs/connect/ado-net/configure-parameters.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Parameterized commands can also improve query execution performance, because the
2525

2626
A <xref:System.Data.Common.DbParameter> object can be created by using its constructor, or by adding it to the <xref:System.Data.Common.DbCommand.DbParameterCollection%2A> by calling the `Add` method of the <xref:System.Data.Common.DbParameterCollection> collection. The `Add` method will take as input either constructor arguments or an existing parameter object, depending on the data provider.
2727

28-
## Supplying the ParameterDirection property
28+
## Supply the ParameterDirection property
2929

3030
When adding parameters, you must supply a <xref:System.Data.ParameterDirection> property for parameters other than input parameters. The following table shows the `ParameterDirection` values that you can use with the <xref:System.Data.ParameterDirection> enumeration.
3131

@@ -36,12 +36,12 @@ When adding parameters, you must supply a <xref:System.Data.ParameterDirection>
3636
|<xref:System.Data.ParameterDirection.Output>|The parameter is an output parameter.|
3737
|<xref:System.Data.ParameterDirection.ReturnValue>|The parameter represents a return value from an operation such as a stored procedure, built-in function, or user-defined function.|
3838

39-
## Working with parameter placeholders
39+
## Work with parameter placeholders
4040

4141
The syntax for parameter placeholders depends on the data source. The Microsoft SqlClient Data Provider for SQL Server handles naming and specifying parameters and parameter placeholders differently.
4242
The SqlClient data provider uses named parameters in the format `@`*parametername*.
4343

44-
## Specifying parameter data types
44+
## Specify parameter data types
4545

4646
The data type of a parameter is specific to the Microsoft SqlClient Data Provider for SQL Server. Specifying the type converts the value of the `Parameter` to the Microsoft SqlClient Data Provider for SQL Server type before passing the value to the data source. You may also specify the type of a `Parameter` in a generic manner by setting the `DbType` property of the `Parameter` object to a particular <xref:System.Data.DbType>.
4747

@@ -84,7 +84,7 @@ The Microsoft SqlClient Data Provider for SQL Server type of a `Parameter` objec
8484
> [!NOTE]
8585
> When you send a null parameter value to the server, you must specify <xref:System.DBNull>, not `null` (`Nothing` in Visual Basic). The null value in the system is an empty object that has no value. <xref:System.DBNull> is used to represent null values.
8686
87-
## Deriving parameter information
87+
## Derive parameter information
8888

8989
Parameters can also be derived from a stored procedure using the `DbCommandBuilder` class. The `SqlCommandBuilder` class provides a static method, `DeriveParameters`, which automatically populates the parameters collection of a command object that uses parameter information from a stored procedure. Note that `DeriveParameters` overwrites any existing parameter information for the command.
9090

@@ -118,4 +118,6 @@ This example demonstrates how to call a SQL Server stored procedure in the `Nort
118118
## See also
119119

120120
- [Commands and parameters](commands-parameters.md)
121+
- [DataAdapters and DataReaders](dataadapters-datareaders.md)
121122
- [Data type mappings in ADO.NET](data-type-mappings-ado-net.md)
123+
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

docs/connect/ado-net/connecting-to-data-source.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In the Microsoft SqlClient data provider, you use a **Connection** object to con
2121

2222
The Microsoft SqlClient Data Provider for SQL Server includes a <xref:Microsoft.Data.SqlClient.SqlConnection> type that is derived from a <xref:System.Data.Common.DbConnection> class.
2323

24-
## In This Section
24+
## In this section
2525

2626
[Establishing the Connection](establishing-connection.md)\
2727
Describes how to use a **Connection** object to establish a connection to a data source.
@@ -35,3 +35,5 @@ Describes how to use an **InfoMessage** event to retrieve informational messages
3535
- [Connection pooling](connection-pooling.md)
3636
- [Commands and parameters](commands-parameters.md)
3737
- [DataAdapters and DataReaders](dataadapters-datareaders.md)
38+
- [Transactions and concurrency](transactions-and-concurrency.md)
39+
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

docs/connect/ado-net/connection-events.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The Microsoft SqlClient Data Provider for SQL Server has **Connection** objects
2626
|**InfoMessage**|Occurs when an informational message is returned from a data source. Informational messages are messages from a data source that do not result in an exception being thrown.|
2727
|**StateChange**|Occurs when the state of the **Connection** changes.|
2828

29-
## Working with the InfoMessage Event
29+
## Work with the InfoMessage event
3030

3131
You can retrieve warnings and informational messages from a SQL Server data source using the <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event of the <xref:Microsoft.Data.SqlClient.SqlConnection> object. Errors returned from the data source with a severity level of 11 through 16 cause an exception to be thrown. However, the <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event can be used to obtain messages from the data source that are not associated with an error. In the case of Microsoft SQL Server, any error with a severity of 10 or less is considered to be an informational message, and can be captured by using the <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event. For more information, see the [Database Engine Error Severities](/sql/relational-databases/errors-events/database-engine-error-severities) article.
3232

@@ -38,7 +38,7 @@ The following code example shows how to add an event handler for the <xref:Micro
3838

3939
[!code-csharp[SqlConnection_._InfoMessage#1](~/../sqlclient/doc/samples/SqlConnection_InfoMessage_StateChange.cs#1)]
4040

41-
## Handling Errors as InfoMessages
41+
## Handle errors as InfoMessages
4242

4343
The <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event will normally fire only for informational and warning messages that are sent from the server. However, when an actual error occurs, the execution of the **ExecuteNonQuery** or **ExecuteReader** method that initiated the server operation is halted and an exception is thrown.
4444

@@ -47,7 +47,7 @@ If you want to continue processing the rest of the statements in a command regar
4747
> [!NOTE]
4848
> An error with a severity level of 17 or above that causes the server to stop processing the command must be handled as an exception. In this case, an exception is thrown regardless of how the error is handled in the <xref:Microsoft.Data.SqlClient.SqlConnection.InfoMessage> event.
4949
50-
## Working with the StateChange Event
50+
## Work with the StateChange event
5151

5252
The **StateChange** event occurs when the state of a **Connection** changes. The **StateChange** event receives <xref:System.Data.StateChangeEventArgs> that enable you to determine the change in state of the **Connection** by using the **OriginalState** and **CurrentState** properties. The **OriginalState** property is a <xref:System.Data.ConnectionState> enumeration that indicates the state of the **Connection** before it changed. **CurrentState** is a <xref:System.Data.ConnectionState> enumeration that indicates the state of the **Connection** after it changed.
5353

@@ -58,3 +58,4 @@ The following code example uses the **StateChange** event to write a message to
5858
## See also
5959

6060
- [Connecting to a data source](connecting-to-data-source.md)
61+
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

docs/connect/ado-net/connection-pooling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ ms.reviewer: v-chmalh
1919

2020
Connecting to a data source can be time consuming. To minimize the cost of opening connections, ADO.NET uses an optimization technique called *connection pooling*, which minimizes the cost of repeatedly opening and closing connections.
2121

22-
## In This Section
22+
## In this section
2323

2424
[SQL Server Connection Pooling (ADO.NET)](sql-server-connection-pooling.md)
2525
Provides an overview of connection pooling and describes how connection pooling works in SQL Server.
2626

2727
## See also
2828

29-
- [Retrieving and Modifying Data in ADO.NET](retrieving-modifying-data.md)
29+
- [Retrieving and modifying data in ADO.NET](retrieving-modifying-data.md)
3030
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

docs/connect/ado-net/connection-string-builders.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ms.reviewer: v-chmalh
2121

2222
In earlier versions of ADO.NET, compile-time checking of connection strings with concatenated string values did not occur, so that at run time, an incorrect keyword generated an <xref:System.ArgumentException>. The Microsoft SqlClient Data Provider for SQL Server includes the strongly typed connection string builder class <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder?displayProperty=nameWithType> that inherits from <xref:System.Data.Common.DbConnectionStringBuilder>.
2323

24-
## Connection String Injection Attacks
24+
## Connection string injection attacks
2525

2626
A connection string injection attack can occur when dynamic string concatenation is used to build connection strings that are based on user input. If the string is not validated and malicious text or characters not escaped, an attacker can potentially access sensitive data or other resources on the server. For example, an attacker could mount an attack by supplying a semicolon and appending an additional value. The connection string is parsed by using a "**last one wins**" algorithm, and the hostile input is substituted for a legitimate value.
2727

@@ -38,7 +38,7 @@ data source=(local);Integrated Security=True;
3838
initial catalog="AdventureWorks;NewValue=Bad"
3939
```
4040

41-
## Building Connection Strings from Configuration Files
41+
## Build connection strings from configuration files
4242

4343
If certain elements of a connection string are known beforehand, they can be stored in a configuration file and retrieved at run time to construct a complete connection string. For example, the name of the database might be known in advance, but not the name of the server. Or you might want a user to supply a name and password at run time without being able to inject other values into the connection string.
4444

@@ -68,3 +68,4 @@ This example demonstrates retrieving a partial connection string from a configur
6868
## See also
6969

7070
- [Connection strings](connection-strings.md)
71+
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

docs/connect/ado-net/connection-string-syntax.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ ms.reviewer: v-chmalh
1919

2020
The <xref:Microsoft.Data.SqlClient> has a `Connection` object that inherits from <xref:System.Data.Common.DbConnection> as well as a provider-specific <xref:System.Data.Common.DbConnection.ConnectionString%2A> property. The specific connection string syntax for the SqlClient provider is documented in its `ConnectionString` property. For more information on connection string syntax, see <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A>.
2121

22-
## Connection String Builders
22+
## Connection string builders
2323

2424
Microsoft SqlClient Data Provider for SQL Server introduced the following connection string builder.
2525

2626
- <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>
2727

2828
The connection string builders allow you to construct syntactically valid connection strings at run time, so you do not have to manually concatenate connection string values in your code. For more information, see [Connection String Builders](connection-string-builders.md).
2929

30-
## Windows Authentication
30+
## Windows authentication
3131

3232
We recommend using Windows Authentication (sometimes referred to as *integrated security*) to connect to data sources that support it. The following table shows the Windows Authentication syntax used with the Microsoft SqlClient Data Provider for SQL Server.
3333

3434
|Provider|Syntax|
3535
|--------------|------------|
3636
|`SqlClient`|`Integrated Security=true;`<br /><br /> `-- or --`<br /><br /> `Integrated Security=SSPI;`|
3737

38-
## SqlClient Connection Strings
38+
## SqlClient connection strings
3939

4040
The syntax for a <xref:Microsoft.Data.SqlClient.SqlConnection> connection string is documented in the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> property. You can use the <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A> property to get or set a connection string for a SQL Server database. The connection string keywords also map to properties in the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder>.
4141

@@ -78,17 +78,17 @@ To connect to a named instance of SQL Server, use the *server name\instance name
7878

7979
You can also set the <xref:Microsoft.Data.SqlClient.SqlConnectionStringBuilder.DataSource%2A> property of the `SqlConnectionStringBuilder` to the instance name when building a connection string. The <xref:Microsoft.Data.SqlClient.SqlConnection.DataSource%2A> property of a <xref:Microsoft.Data.SqlClient.SqlConnection> object is read-only.
8080

81-
### Type System Version Changes
81+
### Type system version changes
8282

8383
The `Type System Version` keyword in a <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> specifies the client-side representation of SQL Server types. See <xref:Microsoft.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> for more information about the `Type System Version` keyword.
8484

85-
## Connecting and Attaching to SQL Server Express User Instances
85+
## Connect and Attach to SQL Server Express user instances
8686

8787
User instances are a feature in SQL Server Express. They allow a user running on a least-privileged local Windows account to attach and run a SQL Server database without requiring administrative privileges. A user instance executes with the user's Windows credentials, not as a service.
8888

8989
For more information on working with user instances, see [SQL Server Express User Instances](./sql/sql-server-express-user-instances.md).
9090

91-
## Using TrustServerCertificate
91+
## Use TrustServerCertificate
9292

9393
The `TrustServerCertificate` keyword is valid only when connecting to a SQL Server instance with a valid certificate. When `TrustServerCertificate` is set to `true`, the transport layer will use TLS/SSL to encrypt the channel and bypass walking the certificate chain to validate trust.
9494

@@ -99,7 +99,7 @@ The `TrustServerCertificate` keyword is valid only when connecting to a SQL Serv
9999
> [!NOTE]
100100
> If `TrustServerCertificate` is set to `true` and encryption is turned on, the encryption level specified on the server will be used even if `Encrypt` is set to `false` in the connection string. The connection will fail otherwise.
101101
102-
### Enabling Encryption
102+
### Enable encryption
103103

104104
To enable encryption when a certificate has not been provisioned on the server, the **Force Protocol Encryption** and the **Trust Server Certificate** options must be set in SQL Server Configuration Manager. In this case, encryption will use a self-signed server certificate without validation if no verifiable certificate has been provisioned on the server.
105105

@@ -123,3 +123,4 @@ For more information, see [Using Encryption Without Validation](/sql/relational-
123123

124124
- [Connection strings](connection-strings.md)
125125
- [Connecting to a data source](connecting-to-data-source.md)
126+
- [Microsoft ADO.NET for SQL Server](microsoft-ado-net-sql-server.md)

0 commit comments

Comments
 (0)