locked
SQL Server TIME data type causes KeyNotFound from ObjectContextServiceProvider.PopulateMemberMetadata RRS feed

  • Question

  • I've got an SQL Server table with a TIME field.  I've created a ADO.Net Entity Model for this table, which correctly maps the TIME to an Edm.Time type.  I've created an ADO.Net Data Service for the model.

    When I use my browser, it appears that this type can't be processed... If I change it to DATETIME or DATETIME2, then I'm in business.

    Here's the exception:


    The server encountered an error processing the request. The exception message is 'The given key was not present in the dictionary.'. See server logs for more details. The exception stack trace is:

    at System.ThrowHelper.ThrowKeyNotFoundException()
       at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMemberMetadata(ResourceType resourceType, MetadataWorkspace workspace, IDictionary`2 entitySets, IDictionary`2 knownTypes)
       at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMetadata(IDictionary`2 knownTypes, IDictionary`2 entitySets)
       at System.Data.Services.Providers.BaseServiceProvider.PopulateMetadata()
       at System.Data.Services.DataService`1.CreateProvider(Type dataServiceType, Object dataSourceInstance, DataServiceConfiguration& configuration)
       at System.Data.Services.DataService`1.EnsureProviderAndConfigForRequest()
       at System.Data.Services.DataService`1.ProcessRequestForMessage(Stream messageBody)
       at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] )
       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</P>

    Friday, March 13, 2009 8:26 PM

Answers

  • Hello cdjohnson,

    We are aware of this problem. TIME is a new type introduced in SQL2008, it is mapped to Timestamp in the CLR and then Edm.Time in EF. Unfortunately Astoria (Both V1 and our latest bits) does not yet support this type. That been said, there is a possibility that we will add it to future versions of Astoria.

    For now, you can use DateTime to replace the Time field. Thanks for reporting the issue.

    Regards,

    PQ

    Peter Q.
    Saturday, March 14, 2009 1:08 AM
    Answerer

All replies

  • Hello cdjohnson,

    We are aware of this problem. TIME is a new type introduced in SQL2008, it is mapped to Timestamp in the CLR and then Edm.Time in EF. Unfortunately Astoria (Both V1 and our latest bits) does not yet support this type. That been said, there is a possibility that we will add it to future versions of Astoria.

    For now, you can use DateTime to replace the Time field. Thanks for reporting the issue.

    Regards,

    PQ

    Peter Q.
    Saturday, March 14, 2009 1:08 AM
    Answerer
  • MAAAAAAAAAAAAAAAN YOOOOOOOOOOOOOU AWEAWEAWEWAEAWAEWAEAWAEAWAEAWEAAWEAWSOOOOOOOOOOOOOOOOOOOOOOME!!!
    Wednesday, March 31, 2010 5:58 PM