This question is locked. New answers and comments are not allowed.
Hi, I'm sure there is a really simple answer to this, but...
I have a RadListBox bound to an OpenAccess datasource. The datasource is filtered on a querystring parameter, which is the string being passed to the parent form but the objects being retrieved use a GUID as the primary key and I get the error:
Invalid cast from 'System.String' to 'System.Guid'
Here is the definition for the datasource:
I have a RadListBox bound to an OpenAccess datasource. The datasource is filtered on a querystring parameter, which is the string being passed to the parent form but the objects being retrieved use a GUID as the primary key and I get the error:
Invalid cast from 'System.String' to 'System.Guid'
Here is the definition for the datasource:
<
telerik:OpenAccessDataSource
ID
=
"OpenAccessDataSource2"
runat
=
"server"
EnableDelete
=
"False"
EnableInsert
=
"False"
EnableUpdate
=
"False"
ObjectContextProvider
=
"WorkProgramme.data.WPEntitiesModel, WorkProgramme.data"
TypeName
=
"WorkProgramme.data.ProjectDeliverable"
Where
=
"WpID == @WpID"
OrderBy
=
"ProjectDeliverableDescription"
>
<
WhereParameters
>
<
asp:QueryStringParameter
Name
=
"WpID"
QueryStringField
=
"projectID"
/>
</
WhereParameters
>
</
telerik:OpenAccessDataSource
>
Here is a portion of the stack trace:
[InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'.]
System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) +9489160
System.String.System.IConvertible.ToType(Type type, IFormatProvider provider) +8
System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +9524264
System.Convert.ChangeType(Object value, Type conversionType) +32
Telerik.OpenAccess.RT.QueryImpl.Execute(Object[] args) +450
Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteOqlQuery(IQuery oqlQuery, Object[] queryArguments, Int32 startRowIndex, Int32 maximumRows) +136
Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1386
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
Telerik.Web.UI.RadListBox.OnDataBinding(EventArgs e) +105
Telerik.Web.UI.RadListBox.PerformSelect() +37
Any help would be appreciated.
Thanks,
Jonathan