Filling the data table [* resolved *]
Hello,
I have problem with filling the data table. The error is in the code below.
Code:
private void frmStudent_Load(object sender, System.EventArgs e)
{
//Setup the connection string, data adapter, and commanbuilder.
//Fill the data table
OleDbConnection m_cnADONetConnection = new OleDbConnection();
OleDbDataAdapter m_daDataAdapter = new OleDbDataAdapter();
DataTable m_dtStudents = new DataTable();
m_cnADONetConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\IBS Library System\LibrarySystem.mdb;Persist Security Info=False";
m_daDataAdapter = new OleDbDataAdapter("Select * student",m_cnADONetConnection);
OleDbCommandBuilder m_cbCommandBuilder = new OleDbCommandBuilder(m_daDataAdapter);
m_daDataAdapter.Fill(m_dtStudents);//Error - An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
m_cnADONetConnection.Open();
}
I would be happy if anyone knows how to solve this problem.
Many thanks in advance
Steve