Skip to content

Commit 2444a7f

Browse files
committed
add oledb and odbc
1 parent 5bbb977 commit 2444a7f

File tree

2 files changed

+53
-47
lines changed

2 files changed

+53
-47
lines changed
Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
## About
22

3-
<!-- A description of the package and where one can find more documentation -->
4-
5-
3+
This package implements a data provider for ODBC data sources.
64

75
## Key Features
86

9-
<!-- The key features of this package -->
10-
11-
*
12-
*
13-
*
7+
Allows access to legacy ODBC data sources.
148

159
## How to Use
1610

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 `OdbcDataReader`. For examples of using an `OdbcDataAdapter`, and of updating an ODBC data source, please see the documentation.
1812

19-
## Main Types
13+
```cs
14+
string queryString = "SELECT DISTINCT CustomerID FROM Orders";
15+
using (OdbcConnection connection = new OdbcConnection(connectionString))
16+
{
17+
OdbcCommand command = new OdbcCommand(queryString, connection);
18+
connection.Open();
19+
OdbcDataReader reader = command.ExecuteReader();
2020

21-
<!-- The main types provided in this library -->
21+
while (reader.Read())
22+
{
23+
Console.WriteLine("CustomerID={0}", reader[0]);
24+
}
2225

23-
The main types provided by this library are:
26+
reader.Close();
27+
}
28+
```
2429

25-
* ``
26-
* ``
27-
* ``
30+
## Main Types
2831

29-
## Additional Documentation
32+
* `OdbcDataAdapter` represents a set of data commands and a database connection that are used to fill a `DataSet` and update the ODBC data source.
33+
* `OdbcDataReader` provides a way of reading a forward-only stream of data rows from an ODBC data source.
34+
* `OdbcCommand` represents an SQL statement or stored procedure to execute against an ODBC data source..
35+
* `OdbcConnection` represents an open connection to an ODBC data source.
3036

31-
<!-- Links to further documentation. Remove conceptual documentation if not available for the library. -->
37+
## Additional Documentation
3238

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.odbc)
3540

3641
## Related Packages
3742

38-
<!-- The related packages associated with this package -->
43+
System.Data.OleDb is a similar package for accessing OLE DB data sources.
3944

4045
## Feedback & Contributing
4146

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.Odbc** 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.
Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
## About
22

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.
64

75
## Key Features
86

9-
<!-- The key features of this package -->
10-
11-
*
12-
*
13-
*
7+
Allows access to legacy OLE DB data sources.
148

159
## How to Use
1610

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+
```
1829

1930
## Main Types
2031

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.
2836

2937
## Additional Documentation
3038

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)
3540

3641
## Related Packages
3742

38-
<!-- The related packages associated with this package -->
43+
System.Data.Odbc is a similar package for accessing ODBC data sources.
3944

4045
## Feedback & Contributing
4146

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

Comments
 (0)