|
1 | 1 | ## About |
2 | 2 |
|
3 | | -<!-- A description of the package and where one can find more documentation --> |
4 | | - |
5 | | - |
| 3 | +This package implements a data provider for OLE DB data sources. |
6 | 4 |
|
7 | 5 | ## Key Features |
8 | 6 |
|
9 | | -<!-- The key features of this package --> |
10 | | - |
11 | | -* |
12 | | -* |
13 | | -* |
| 7 | +Allows access to legacy OLE DB data sources. |
14 | 8 |
|
15 | 9 | ## How to Use |
16 | 10 |
|
17 | | -<!-- A compelling example on how to use this package with code, as well as any specific guidelines for when to use the package --> |
| 11 | +This is a basic example of retrieving the results of a query using an `OleDbDataReader`. For examples of using an `OleDbDataAdapter`, and of updating an OLE DB data source, please see the documentation. |
| 12 | + |
| 13 | +```cs |
| 14 | +string queryString = "SELECT OrderID, CustomerID FROM Orders"; |
| 15 | +using (OleDbConnection connection = new OleDbConnection(connectionString)) |
| 16 | +{ |
| 17 | + OleDbCommand command = new OleDbCommand(queryString, connection); |
| 18 | + connection.Open(); |
| 19 | + OleDbDataReader reader = command.ExecuteReader(); |
| 20 | + |
| 21 | + while (reader.Read()) |
| 22 | + { |
| 23 | + Console.WriteLine(reader.GetInt32(0) + ", " + reader.GetString(1)); |
| 24 | + } |
| 25 | + // always call Close when done reading. |
| 26 | + reader.Close(); |
| 27 | +} |
| 28 | +``` |
18 | 29 |
|
19 | 30 | ## Main Types |
20 | 31 |
|
21 | | -<!-- The main types provided in this library --> |
22 | | - |
23 | | -The main types provided by this library are: |
24 | | - |
25 | | -* `` |
26 | | -* `` |
27 | | -* `` |
| 32 | +* `OleDbDataAdapter` represents a set of data commands and a database connection that are used to fill a `DataSet` and update the OLE DB data source. |
| 33 | +* `OleDbDataReader` provides a way of reading a forward-only stream of data rows from an OLE DB data source. |
| 34 | +* `OleDbCommand` represents an SQL statement or stored procedure to execute against an OLE DB data source. |
| 35 | +* `OleDbConnection` represents an open connection to an OLE DB data source. |
28 | 36 |
|
29 | 37 | ## Additional Documentation |
30 | 38 |
|
31 | | -<!-- Links to further documentation. Remove conceptual documentation if not available for the library. --> |
32 | | - |
33 | | -* [Conceptual documentation](https://learn.microsoft.com/en-us/dotnet/standard/serialization/**LIBRARYNAME**/overview) |
34 | | -* [API documentation](https://learn.microsoft.com/en-us/dotnet/api/**LIBRARYNAME**) |
| 39 | +* [API documentation](https://learn.microsoft.com/en-us/dotnet/api/system.data.oledb) |
35 | 40 |
|
36 | 41 | ## Related Packages |
37 | 42 |
|
38 | | -<!-- The related packages associated with this package --> |
| 43 | +System.Data.Odbc is a similar package for accessing ODBC data sources. |
39 | 44 |
|
40 | 45 | ## Feedback & Contributing |
41 | 46 |
|
42 | | -<!-- How to provide feedback on this package and contribute to it --> |
43 | | - |
44 | | -**LIBRARY NAME** is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime). |
| 47 | +**System.Data.OleDb** is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports are welcome at [the GitHub repository](https://github.com/dotnet/runtime). This package is considered complete and we only consider lower-risk or high-impact fixes that will maintain or improve quality. |
0 commit comments