1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
public string ReadCell(string sheet, string column, string row)
{
useHDR=false;
if(useHDR==false)
{
string Query;
ADODB.Recordset Record = new ADODB.Recordset();
Query = "[" + sheet + "$" + column + row + ":" + column + row + "]";
Record.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
Record.Open(Query, DBConnection, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic, 0);
if(System.Convert.ToString(Record.Fields[0].Value)=="")
{
readcell="Cellule Vide";
}
else
{
readcell = System.Convert.ToString(Record.Fields[0].Value);
}
//Close the Recordset
Record.Close();
}
return readcell;
} |
Partager