Results 1 to 1 of 1

Thread: Filling the data table [* resolved *]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    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
    Last edited by steve_rm; Aug 20th, 2004 at 08:29 AM.
    steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width