如何从 C# 访问关系 SQL 数据库?

How do I access a relational SQL database from C#?

首先,我可以使用 JDBC 在 Java 中执行此操作。我正在寻找的是 C# 的 JDBC 的等价物。它需要访问所有类型的数据库。我的搜索没有发现任何对我有用的东西。 编辑:现在,我要尝试 ADO.NET

这是一个非常宽泛的问题,但您可能需要 ADO.NET,这应该可以帮助您入门。

ADO.NET provides consistent access to data sources such as SQL Server and XML, and to data sources exposed through OLE DB and ODBC. Data-sharing consumer applications can use ADO.NET to connect to these data sources and retrieve, handle, and update the data that they contain.

ADO.Net 是处理数据库访问的 .Net 本机等效项。 MSDN link to ADO.Net