How to query MS Access database with C# application?

前端 未结 3 1970
没有蜡笔的小新
没有蜡笔的小新 2020-12-21 04:16

I have an application that uses Microsoft.Office.Interop.Excel to pull data from an Excel workbook. The information in the Excel workbook has been moved to an

3条回答
  •  眼角桃花
    2020-12-21 04:22

    The easiest way is to use ADO.Net to access it just like you would any other database. Create an OleDbConnection object passing in an appropriate conenction string. Here's an example:

    var conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\emp.mdb;");
    

提交回复
热议问题