小编neb*_*ula的帖子

LINQ to Entities Exception不支持指定的类型成员'Date'

我在实现以下语句时遇到异常.

 DateTime result;
 if (!DateTime.TryParse(rule.data, out result))
     return jobdescriptions;
 if (result < new DateTime(1754, 1, 1)) // sql can't handle dates before 1-1-1753
     return jobdescriptions;
 return jobdescriptions.Where(j => j.JobDeadline.Date == Convert.ToDateTime(rule.data).Date );
Run Code Online (Sandbox Code Playgroud)

例外

The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
Run Code Online (Sandbox Code Playgroud)

我知道异常意味着什么,但我不知道如何摆脱它.有帮助吗?

linq-to-entities entity-framework

99
推荐指数
4
解决办法
7万
查看次数

找不到元素'beans'的声明

我有春季罐子,spring-3.2.0.RC1.jar并尝试Apache ActiveMQ helloWorld这里给出的教程实现程序.xml配置文件是:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns:jms="http://www.springframework.org/schema/jms"
    xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.springframework.org/schema/beans"
    xsi:schemalocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/jms 
    http://www.springframework.org/schema/jms/spring-jms.xsd">

    <bean class="org.apache.activemq.command.ActiveMQQueue" id="destination">
        <constructor-arg value="TEST.Q1"></constructor-arg>
    </bean>

    <bean class="org.apache.activemq.ActiveMQConnectionFactory" id="connectionFactory"
        p:brokerurl="tcp://localhost:8161"></bean>

    <bean class="com.jms.helloworld.listner.MessageListenerImpl" id="simpleMessageListener">
        <bean
            class="org.springframework.jms.listener.DefaultMessageListenerContainer"
            id="jmsContainer">
            <property name="connectionFactory" ref="connectionFactory"></property>
            <property name="destination" ref="destination"></property>
            <property name="messageListener" ref="simpleMessageListener"></property>
        </bean>
    </bean>
</beans>    
Run Code Online (Sandbox Code Playgroud)

主要:

public static void main(String[] args) throws JMSException {
        System.out.println("LISTNER STARTED");
        ApplicationContext context =  new FileSystemXmlApplicationContext("src/com/jms/helloworld/config/JMSConfig.xml");
    }

**Exception on console**


LISTNER STARTED
log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment). …
Run Code Online (Sandbox Code Playgroud)

java spring activemq-classic message-queue

25
推荐指数
3
解决办法
10万
查看次数

在剃刀视图中的Javascript url操作

我有一个javascript方法onRowSelectedwchich得到rowid.如何在控制器的某些动作中传递rowid HttpGet

function onRowSelected(rowid, status) {
        alert('This row has id: ' + rowid);
        //url: @Action.Url("Action","Controller")
        //post:"GET"
        // Something like this?
    }
Run Code Online (Sandbox Code Playgroud)

javascript razor asp.net-mvc-3

17
推荐指数
1
解决办法
5万
查看次数

数字增加数测试

对于1到9之间的某个数字n,如果它等于n + nn + nnn + ...,则数字称为数字增加.例如,24是数字增加,因为它等于2 + 22(这里n = 2).

实际上,我的一个朋友问我这个问题,我一直在考虑它,但到目前为止找不到确切的解决方案.有人可以帮忙吗?我需要的函数如果是数字增加则返回true,否则返回false.

c c++ algorithm logic

12
推荐指数
1
解决办法
2486
查看次数

在窗口中找到JFrame的位置/位置

我试图找到JFrame的起始位置/位置,以便将鼠标光标从JFrame窗口映射到桌面.有没有找到JFrame的X,Y位置?

java swing location jframe

10
推荐指数
1
解决办法
2万
查看次数

必须在方法'Skip'Exception之前调用'OrderBy'方法

我试图实现jQgrid使用MvcjQgrid,我得到了这个例外.

System.NotSupportedException was unhandled by user code
  Message=The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.
Run Code Online (Sandbox Code Playgroud)

虽然在Skip方法之前使用OrdeyBy为什么它会产生异常?怎么解决?

我在控制器中遇到异常:

public ActionResult GridDataBasic(GridSettings gridSettings)
        {          
            var jobdescription = sm.GetJobDescription(gridSettings);
            var totalJobDescription = sm.CountJobDescription(gridSettings);

            var jsonData = new
            {
                total = totalJobDescription / gridSettings.PageSize + 1,
                page = gridSettings.PageIndex,
                records = totalJobDescription,
                rows = (
                    from j in jobdescription
                    select new
                    {
                        id = j.JobDescriptionID, …
Run Code Online (Sandbox Code Playgroud)

linq-to-entities entity-framework asp.net-mvc-3 mvcjqgrid

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

如何加入多个表?

我有以下课程.我有一个varDescription类的对象.我想var使用Linq to Sql或Lambda表达式选择与对象中提供的客户端相关的Balance .如何连接这些表以从帐户表中获取余额?

public class Description
    {
        public int DescriptionID { get; set; }

       // Attributes

        public int ClientID { get; set; }

        [ForeignKey("ClientID")]
        public virtual Client Client { get; set; }


    }

public class Client
    {
        public int ClientID { get; set; }

       // Attributes

        public int UserID { get; set; }

        [ForeignKey("UserID")]
        public virtual User User { get; set; }

    }

 public class User
    {
        public int UserID { get; set; }

       // …
Run Code Online (Sandbox Code Playgroud)

lambda entity-framework code-first linq-to-sql

6
推荐指数
1
解决办法
5万
查看次数

日期选择器在页面加载期间设置日期

我有一个日期选择器,但是当页面第一次加载时它没有在输入中显示日期。日期仅在单击后设置。

$('#starts-on').datepicker({ 
            dateFormat: 'MM dd, yy' ,
        }).datepicker( "option", { setDate:"0",
                maxDate:'+3y -1d',
                minDate:'0' } );
Run Code Online (Sandbox Code Playgroud)

第一次加载页面时如何加载日期?此外,我想禁用文本框来添加文本。有什么帮助吗?

jquery datepicker

5
推荐指数
1
解决办法
2万
查看次数

在Div中禁用鼠标和键事件

我有多个Html元素div.有没有办法禁用该Div的鼠标和键事件(不是针对单个元素)?元素是自动生成的,并且位于多个跨度内.因此我只想禁用整个div,以便不能改变任何东西readonly.

html jquery

5
推荐指数
2
解决办法
3万
查看次数

jQuery:替换onclick事件

我有以下代码:

  $('#tableA').find("#expand_" + row_id).prop("onclick", null);
  $('#tableA').find("#expand_" + row_id).prop("onclick", 'expandAndShow('+row_id+')');
  $('#tableA').find("#expand_" + row_id).removeClass('icon-plus-sign');
  $('#tableA').find("#expand_" + row_id).addClass('icon-ok-sign');
Run Code Online (Sandbox Code Playgroud)

我想onlick用新方法替换以前链接的方法。它不起作用。但是,removeClass并且addClass运行良好。我有什么想念的吗?

javascript jquery jquery-ui

5
推荐指数
1
解决办法
8475
查看次数