How can I create access 2000-2003 file using C# WPF and add tables in, data in and perform queries on it?
I`m using MS Visual Studio 2010
this is what I`ve been able to accomplish:
OleDbConnection conn = new OleDbConnection();
string myDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string dbPath = myDir + @"\EmpMan.mdb";
MessageBox.Show(myDir);
if (!File.Exists(dbPath))
{
//Here I want my program to create an Access DB File in the dbPath location...
}
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbPath + ";Password=EmpMan";
try
{
conn.Open();
}
catch (OleDbException ex)
{
MessageBox.Show("Error: " + ex.Errors[0].Message);
Application.Current.Shutdown();
}