sql ="select * FROM Tb_SCh_TIme_Table P PIVOT "; sql = sql + "(MAX(Faculty_Code) FOR Session IN ([1],[2],[3] ,[4])) AS PVT "; sql = sql + " where course = '" + dr[0].ToString().Trim() + "' order by date"; Xldr = GFun.ReadSql(sql); while (Xldr.Read()) { xlWorkSheet.Cells[xlRow, 1] = Xldr[1].ToString(); xlWorkSheet.Cells[xlRow, 2] = Xldr[3].ToString(); xlWorkSheet.Cells[xlRow, 3] = Xldr[4].ToString(); xlWorkSheet.Cells[xlRow, 4] = Xldr[5].ToString(); xlWorkSheet.Cells[xlRow, 5] = Xldr[6].ToString(); if (Xldr[3].ToString().Trim() == "") { //xlWorkSheet.Cells.Interior.ColorIndex = Color.Red; xlWorkSheet.Cells.Interior.Color = Color.Red; } }
if (Xldr[3].ToString().Trim() == " ") { xlWorkSheet.Cells.Interior.Color = Color.Red; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)