Adding index on property after Dynamic Data Store has been created

Vote:
 

Hi!

I am saving a custom type in Dynamic Data Store, and after the DDS Store was first created I realized it would be good to decorate one of the properties with the 

[EPiServerDataIndex]

attribute, since I will filter the data on that property.

I have decorated the class with
[EPiServerDataStore(AutomaticallyCreateStore = true, AutomaticallyRemapStore=true)]


But after adding the indexing attribute on one of my properties I get this error message whenever I try to interact with the Store:

Server Error in '/' Application.


Incorrect syntax near 'SE'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'SE'.

Source Error: 

Line 24: 		public DynamicDataStore GetStore()
Line 25: 		{
Line 26: 			DynamicDataStore store = DynamicDataStoreFactory.Instance.GetStore(typeof(T));
Line 27: 			return store;
Line 28: 		}

Source File: C:\inetpub\XXX\www\Classes\DataStore\DdsRepositoryOfType.cs    Line: 26 

Stack Trace: 

[SqlException (0x80131904): Incorrect syntax near 'SE'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +212
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1099
   System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +2858575
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +470
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +182
   EPiServer.Data.Dynamic.Providers.<>c__DisplayClass24.<SaveStoreDefinition>b__23() +82
   EPiServer.Data.Dynamic.Providers.<>c__DisplayClass7.<ExecuteTransaction>b__6() +384
   EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.InternalExecute(Func`1 method) +189
   EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.ExecuteTransaction(Action action) +142
   EPiServer.Data.Dynamic.<>c__DisplayClass24.<CommitChanges>b__21() +385

[InvalidOperationException: Failed to commit changes - see inner exception]
   EPiServer.Data.Dynamic.EPiServerDynamicDataStoreFactory.GetStore(Type type) +285
   XXX.Classes.DataStore.DdsRepository`1.GetStore() in C:\inetpub\XXX\www\Classes\DataStore\DdsRepositoryOfType.cs:26
   XXX.Classes.DataStore.DataSources.CourseApplicationItemDataSource.GetQuery(String courseOrtNamn) in C:\inetpub\XXX\www\Classes\DataStore\DataSources\CourseApplicationItemDataSource.cs:26
   XXX.Classes.DataStore.DataSources.CourseApplicationItemDataSource.GetData(Int32 startRowIndex, Int32 pageSize, String courseOrtNamn) in C:\inetpub\XXX\www\Classes\DataStore\DataSources\CourseApplicationItemDataSource.cs:21

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +1255
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
   System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +897
   System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1848
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +27
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +261
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +95
   System.Web.UI.Control.EnsureChildControls() +146
   System.Web.UI.Control.PreRenderRecursiveInternal() +61
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394
 

Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456


Does anyone know what to do? Any input is most welcome.

/Dan
#61248
Sep 12, 2012 16:54
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.