Cells.ImportDataTable() Not Working For Boolean DataType


#1

Hello Lawrence,

I think I might have stumbled upon a bug in the Cells.ImportDataTable() method, and wanted to report it… Here the some C# code to reproduct it:

-----------------------------------------------------------------------------------
DataTable table = new DataTable();
table.Columns.Add(“BooleanColumn”, typeof(System.Boolean));
DataRow row = table.NewRow();
row[“BooleanColumn”] = true;
table.Rows.Add(row);
cells.ImportDataTable(table, false, 0, 0);
Response.Write(cells[0,0].BoolValue);
-----------------------------------------------------------------------------------

When I run that chunk of code, I get the following Exception:

-----------------------------------------------------------------------------------
System.Exception: Cell contains no data
-----------------------------------------------------------------------------------

The Cells.ImportDataTable() function seems to work for Strings, Ints, DateTimes, and Decimals, but not for Booleans…

Am I doing something wrong???

Thanks,

-Dana


#2

Hi Dana,

No one asked for booleans before :). Now it’s available. Please download fix 1.8.5.2 and have a try.


#3

Thanks again for the prompt response… I’ll give it a try…:slight_smile:

-Dana