Reading specific values from Excel using Selenium and C#
The below can be used to retrieve specific key value pairs from the Workbook which has been already read by C# code
Please see the previous post about how to read a Workbook in C#
// Here PageName is the SheetName
// TestDataIdentifier is nothing but Key value pair (Column1 is key and Column2 is Value)
public static string GetTestDataValue(string PageName, string TestDataIdentifier)
{
var query =
from r in ds.Tables[PageName].AsEnumerable()
where r.Field<string>("TestDataIdentifier").Equals(TestDataIdentifier)
select r.Field<string>("TestDataValue");
var name = query.FirstOrDefault();
return name;
}