Ok, still not 100% sure what you are trying to accomplish, but I do know that the biggest issue is the way you are looping with the data reader.
I've taken your original code and converted to a datatable and it outputs the following in the richtextbox1: Section: 32 Measurdate 7/20/2010 12:00:00 AM
Here is the modified code with a datatable you can actually use to loop with:
int[] fj1Sections = {1,35,33,32,20,19,17,16,18};
bool test = true;
string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=car_mos.accdb;Persist Security Info=False";
string queryString =
"SELECT dbo_SectionMeasure.[BakingFurnaceNo], dbo_SectionMeasure.[SectionNo], dbo_SectionMeasure.[MeasureDate], dbo_SectionMeasure.[IsLastValue] FROM dbo_SectionMeasure ORDER BY dbo_SectionMeasure.[MeasureDate] DESC;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
OleDbCommand command = new OleDbCommand(queryString, connection);
DataTable dt = new DataTable();
dt.Load(command.ExecuteReader());
try
{
OleDbDataReader reader = command.ExecuteReader();
for (int i = 0; i < fj1Sections.Count() ; i++)
{
for(int x=0;x<dt.Rows.Count;x++)
{
string section_no = dt.Rows[x][1].ToString();
if ((section_no == fj1Sections[i].ToString()))
{
//result;
richTextBox1.Text = "Section: " + fj1Sections[i].ToString() + " Measurdate " + dt.Rows[x][2].ToString();
}
}
}
}
catch (Exception ee)
{
richTextBox1.Text = ee.ToString();
}
I'm sure there is a more efficient way to do this, but hopefully this gets you going!