开发者

creating accdb file from C#

开发者 https://www.devze.com 2023-02-04 08:40 出处:网络
I want to create Ms access2007 file programatically from c# using Microsoft.ACE.OLEDB开发者_Python百科.12.0Here is some example:

I want to create Ms access2007 file programatically from c# using Microsoft.ACE.OLEDB开发者_Python百科.12.0


Here is some example:

    using System;
    using ADOX;

    namespace ConsoleApplication1
    {
        class Class1
        {
            [STAThread]
            static void Main(string[] args)
            {
                ADOX.Catalog cat = new ADOX.Catalog();

                cat.Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;");

                Console.WriteLine("Database Created Successfully");

                cat = null;

            }
        }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消