Two possible problems: one is (as 0x01AA said) that the command is not connected to any database. The other is that you should have a space between "SELECT" and "*" in your SQL command - it's not required, but it's a good idea - particularly as "SELECT *" is considered a bad idea anyway. You should name your columns in the SELECT so that you only fetch the ones you need.
In addition, Commands and Connections are scarce resources, and it's a good idea to use a using block to ensure they are closed and disposed as needed.
try
{
using (OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0; Data Source = C:\Users\Ahmed ch\Documents\Database1.accdb;Persist Security Info = False;";))
{
con.Open();
using (OleDbCommand cmd = new OleDbCommand("SELECT ProductName FROM Sheet2", con))
{
using (OleDbDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
comboBox1.Items.Add(reader["ProductName"].ToString());
}
}
}
}
}
catch(Exception ex)
{
MessageBox.Show("Error" + ex);
}