C# Corner
Tech
News
Videos
Forums
Trainings
Books
Live
More
Interviews
Events
Jobs
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Create an Access Database by using ADOX and Visual C# .NET
WhatsApp
Samir Bhogayta
9y
45.1
k
0
1
25
Blog
Build an Access Database:
Open a new Visual C# .NET console application.
In Solution Explorer, right-click the References node and select Add Reference.
On the COM tab, select Microsoft ADO Ext. 2.7 for DDL and Security, click Select to add it to the Selected Components, and then click OK.
Delete all of the code from the code window for Class1.cs.
Paste the following code into the code window,
using
System;
using
ADOX;
private
void
btnCreate_Click(
object
sender, EventArgs e)
{
ADOX.CatalogClass cat =
new
ADOX.CatalogClass();
cat.Create(
"Provider=Microsoft.Jet.OLEDB.4.0;"
+
"Data Source=D:\\NewMDB.mdb;"
+
"Jet OLEDB:Engine Type=5"
);
MessageBox.Show(
"Database Created Successfully"
);
cat =
null
;
}
People also reading
Membership not found