You do a loop on columns with Fields[i]...
For example, a test where I read the second column (index = 1, named "LastName") of an "Employees" table =>
string sMyDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string sPath = sMyDocumentsPath + "\\Employees.mdb";
string sPassword = "toto";
DBEngine dbEngine = new DBEngine();
try
{
Database db = dbEngine.OpenDatabase(sPath, true, false, ";PWD=" + sPassword);
if (db != null)
{
Recordset rst = db.OpenRecordset("SELECT * FROM Employees WHERE Salary >= 40000");
while (!rst.EOF)
{
// Second column
comboBox1.Items.Add(rst.Fields[1].Value);
//comboBox1.Items.Add(rst.Fields["LastName"].Value);
rst.MoveNext();
}
}
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show("Database Error : " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}