小编Naw*_*.io的帖子

DbArithmeticExpression参数必须具有数字公共类型

TimeSpan time24 = new TimeSpan(24, 0, 0);
TimeSpan time18 = new TimeSpan(18, 0, 0);    

// first get today's sleeping hours
List<Model.Sleep> sleeps = context.Sleeps.Where(
    o => (clientDateTime - o.ClientDateTimeStamp < time24) && 
          o.ClientDateTimeStamp.TimeOfDay > time18 && 
          clientDateTime.TimeOfDay < time18 && 
          o.UserID == userid).ToList(); 
Run Code Online (Sandbox Code Playgroud)

此Linq表达式抛出此异常:

DbArithmeticExpression arguments must have a numeric common type.
Run Code Online (Sandbox Code Playgroud)

请帮忙!

c# ado.net entity-framework

114
推荐指数
1
解决办法
3万
查看次数

我得到For TransferMode.Buffered,MaxReceivedMessageSize和MaxBufferSize必须为相同的值

这是我在Windows Azure Services Project上的Web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <configSections>
  </configSections>
  <!--  To collect diagnostic traces, uncomment the section below or merge with existing system.diagnostics section.
        To persist the traces to storage, update the DiagnosticsConnectionString setting with your storage credentials.
        To avoid performance degradation, remember to disable tracing on production deployments.
  <system.diagnostics>     
    <sharedListeners>
      <add name="AzureLocalStorage" type="NutriLeaf.Services.AzureLocalStorageTraceListener, NutriLeaf.Services"/>
    </sharedListeners>
    <sources>
      <source name="System.ServiceModel" switchValue="Verbose, ActivityTracing">
        <listeners>
          <add name="AzureLocalStorage"/>
        </listeners>
      </source>
      <source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
        <listeners>
          <add name="AzureLocalStorage"/>
        </listeners>
      </source>
    </sources> 
   </system.diagnostics> -->

  <system.diagnostics>
    <trace> …
Run Code Online (Sandbox Code Playgroud)

iis wcf azure windows-phone-7.1

4
推荐指数
2
解决办法
7102
查看次数

标签 统计

ado.net ×1

azure ×1

c# ×1

entity-framework ×1

iis ×1

wcf ×1

windows-phone-7.1 ×1