richard smith

richard smith

  • 1.1k
  • 285
  • 157.2k

C# OLEDBConnection

Mar 15 2013 6:23 PM
I want to use C# OLEDBConnection to open an access database and build a query in that database and then save the query.  So for example, I want to build a query of SELECT * From tblCustInfo then after that I want to SELECT ZIP from tbl_City so the query would hold all of the info from tbl_custInfo and then the zips from tbl_City.

I know how to open a database via OLEDBConnection, I just don't know how to select data from tables (or 2 tables for that matter!)or how to save the query once I have it built out.

            OleDbConnection olecon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + databaseNamae);
            olecon.Open();

Answers (7)