Hi venkatsan,
Check your ole.Fill(ds1). Your dataset does not have any table. So there is no table at index 0. Make sure that your query and connections are correct.
You need to check the table count > 0 after the fill methid then do your stuff.
ole.Fill(ds1);
if (ds1.Tables.Count > 0)
{
string value = ds1.Tables[0].Rows[0]["a"].ToString();
}