Я использую EntityDataSource
, я получаю преобразование об ошибке после того, как я отформатировать датуНевозможно преобразовать значение параметра 'Дата' в тип 'System.DateTime'. '
так: DataFormatString="{0:dd/MM/yyyy}"
[EntityDataSourceValidationException: Error while setting property 'fromDate': 'Cannot convert the value of parameter 'fromDate' to the type 'System.DateTime'.'.]
Microsoft.AspNet.EntityDataSource.EntityDataSourceView.ConvertProperties(IDictionary values, PropertyDescriptorCollection propertyDescriptors, ParameterCollection referenceParameters, Dictionary`2 convertedValues) +737
Microsoft.AspNet.EntityDataSource.EntityDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +383
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +84
Telerik.Web.UI.GridTableView.PerformDelete(GridEditableItem editedItem, Boolean suppressRebind) +228
Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +2417
Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +91
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
Мой Aspx:
<telerik:GridDateTimeColumn HeaderText="تاريخ البداية" UniqueName="fromDate" SortExpression="fromDate" DataField="fromDate" DataFormatString="{0:dd/MM/yyyy}"></telerik:GridDateTimeColumn>
Примечание:
fromDate
типаDate
в SQLServer дб
'DataField = "FromDate"' не должно быть 'DataField = fromDate'? –
@ SonerGönül: Не могли бы вы объяснить, что вы имеете в виду? 'DataField' является свойством столбца сетки –