Hi,
I am using the Batch Update method as found in the help files as follows:
When performing the update, the update fails when it encounters a Null value. (Not all the records always need a value)
The data in question is coming from the below BoundColumn,
<telerik:GridBoundColumn UniqueName="PaidType" DataType="System.String" ConvertEmptyStringToNull="true" HeaderText="PaidType" DataField="PaidType" />
Could someone advise how I can deal with these null values?
Thanks in advance.
Harry
I am using the Batch Update method as found in the help files as follows:
Hashtable newValues = new Hashtable(); |
//The GridTableView will fill the values from all editable columns in the hash |
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); |
//sqlUpdatePayments.UpdateCommand = String.Format("Update Customers SET ContactName='{0}' WHERE CustomerID='{1}'", newValues["ContactName"], editedItem.GetDataKeyValue("CustomerID").ToString()); |
sqlUpdatePayments.UpdateCommand = String.Format("UPDATE [MainBookings] SET [PaidType] = '{0}' WHERE [ClassBookedID] = '{1}'", newValues["PaidType"].ToString(), editedItem.GetDataKeyValue("ClassBookedID").ToString()); |
sqlUpdatePayments.Update(); |
When performing the update, the update fails when it encounters a Null value. (Not all the records always need a value)
The data in question is coming from the below BoundColumn,
<telerik:GridBoundColumn UniqueName="PaidType" DataType="System.String" ConvertEmptyStringToNull="true" HeaderText="PaidType" DataField="PaidType" />
Could someone advise how I can deal with these null values?
Thanks in advance.
Harry