I am using DataReader to write data to excelsheet cells. I have no problem until the camera writes prevail. But in one case, only one cell is readonly, and the rest of the cells are writable.
For example: 10 * 10 cells, only the first cell is read-only. therefore, I delete this cell and write it to the remaining cells. But with a data reader, it writes a whole line at a time .. so how can I achieve this with C #?
Team Leader (required) , , , , , , , , ,
, , , , , , , , , ,
, , , , , , , , , ,
, , , , , , , , , ,
, , , , , , , , , ,
therefore, the first cell should not be written by datareader. Please help me with this.
if (reader.HasRows)
{
minRow = 0;
minCol = 0;
while (reader.Read())
{
object[] values = new object[reader.FieldCount];
rowList.Add(values);
reader.GetValues(values);
int iValueIndex = 0;
if (CurTaskNode.ReadFormat == "ColumnbyColumn")
{
minCol = 0;
for (int iCol = 0; iCol < CurTaskNode.HeaderData.Length; iCol++)
{
if (CurTaskNode.HeaderData[minCol] != "")
{
excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol] = values[iValueIndex];
iValueIndex++;
}
minCol++;
}
minRow++;
}
}
}
Thanks Ramm