Saeed
July 28th, 2005, 08:52 PM
I downloaded teh sample code included for db example from msdn but it was out of date .Phewww
I created a dummy Access db with atable that has a few records and columns to populate my GridControl .
However for some reason (whether its a param missing or access security) am unable to connect to the database. Has anyone done anything like this that can help ? cheers
System.Data.OleDb.OleDbConnection conn = new
System.Data.OleDb.OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source= D:\Mooo.mdb";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
MessageBox.Show("Failed to connect to data source");
}
finally
{
conn.Close();
this.Close();
}
Thanks in Advance.
I created a dummy Access db with atable that has a few records and columns to populate my GridControl .
However for some reason (whether its a param missing or access security) am unable to connect to the database. Has anyone done anything like this that can help ? cheers
System.Data.OleDb.OleDbConnection conn = new
System.Data.OleDb.OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source= D:\Mooo.mdb";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
MessageBox.Show("Failed to connect to data source");
}
finally
{
conn.Close();
this.Close();
}
Thanks in Advance.