Hi All,
I m trying to read the value of three columns
first one is checkedboxcolumn
second column is textboxcolumn containing a number and I want to save it as integer
third column is textboxcolumn containing a string
the problem I have is that whenever I try to read a value directly from a grid view it is always throwing an exception and the value of the cell is always null
when the cell is null ?
when the cell.value is null ?
here is my code :
command.Parameters.Add("@Active", SqlDbType.Bit).Value = (int)gvEventsType.Rows[rowIndex].Cells[gvEventsType.Columns["ActiveCol"].Index].Value;
command.Parameters.Add("@EventTypeName", SqlDbType.NVarChar).Value = (string)gvEventsType.Rows[rowIndex].Cells[gvEventsType.Columns["EventsTypeNameCol"].Index].Value;
command.Parameters.Add("@DefaultPromoteWeeks", SqlDbType.Int).Value = (int)gvEventsType.Rows[rowIndex].Cells[gvEventsType.Columns["PromotionWeeksCol"].Index].Value;