I am not exactly clear on what you are trying to accomplish. But you certainly use C# to fetch row data using a code similar to the following:
private void LoadData()
{
OleDbConnection con = new OleDbConnection();
try
{
String strConnectionString = @"Provider = Microsoft.Jet.OLEDB.4.0; Mode = 16; Data Source = " + System.Configuration.ConfigurationSettings.AppSettings["DatabaseLocation"] + "; Extended Properties = " + "\"Excel 8.0;\"";
con.ConnectionString = strConnectionString;
OleDbCommand cmdFetchExistingRecord = new OleDbCommand();
cmdFetchExistingRecord.Connection = con;
DataSet dataSet = new DataSet();
cmdFetchExistingRecord.CommandText = "SELECT * FROM MyTable";
OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter(cmdFetchExistingRecord);
con.Open();
oleDbDataAdapter.Fill(dataSet, "hData");
if (dataSet.Tables[0].Rows.Count > 0)
{
txtAgency_State.Text = DecryptData(dataSet.Tables[0].Rows[0]["Agency_State"].ToString());
}
else
{
}
}
catch
{
MessageBox.Show("An unexpected error occurred.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
con.Close();
}
}