SoFunction
Updated on 2025-03-07

Oledb connection access database example

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            OleDbConnection conn = new OleDbConnection();
            OleDbCommand comm = new OleDbCommand();
            OleDbDataReader dr=null;
            = "Provider=.4.0;Data Source=" + + "\\";
            = conn;
            = "select * from [login]";
            try
            {
                ();
                dr = ();
                while (())
                {
                    for (int i = 0; i < ; i++)
                        ((i) + "  ");
                    ("");
                    //();
                }
                ();
            }
            catch (Exception err)
            {
                ();
            }
            finally
            {
                comm = null;
                ();
                comm = null;
                ();
            }
        }
    }
}