小编Sii*_*ick的帖子

由于<AnonymousType>,无法与Linq一起使用.Union

我有点不解决这个问题.希望我会得到一些帮助.这就是重点.我必须用我的SQL请求填充我的DataGridView:

SELECT LOT.NumLot, EtatLot, NomEmploye FROM LOT
JOIN AFFECTATION_LOT on LOT.NumLot=AFFECTATION_LOT.NumLot
JOIN EMPLOYE on AFFECTATION_LOT.IdEmploye=EMPLOYE.IdEmploye
WHERE EtatLot='Libéré' or EtatLot='Suspendu' or EtatLot='Démarré'
UNION
SELECT NumLot, EtatLot, null FROM LOT
WHERE EtatLot='Démarré'
Run Code Online (Sandbox Code Playgroud)

首先,我在第二个"SELECT"中使用了"null"值,因为"UNION"需要有3个参数,如第一个"SELECT",并且我的表LOT中没有"NomEmploye"数据.无论如何,该请求在SQL中运行良好.但是当我尝试在LINQ中使用它时

string test = "null";
var listeLotControle = (from x in entBoum.LOT
                        join aff in entBoum.AFFECTATION_LOT on x.NumLot equals aff.NumLot
                        join emp in entBoum.EMPLOYE on aff.IdEmploye equals emp.IdEmploye
                        where x.EtatLot.Contains("Libéré") || x.EtatLot.Contains("Suspendu") || x.EtatLot.Contains("Démarré")
                        select new { x.NumLot, x.EtatLot, emp.NomEmploye }).Union
                        (from x in entBoum.LOT
                        where x.EtatLot.Contains("Démarré")
                        select new { …
Run Code Online (Sandbox Code Playgroud)

c# linq sql-server datagridview

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

在Symfony2中使用Doctrine映射异常错误

我需要你的帮助,因为这就像有一天我在Symfony 2中遇到了映射问题.

首先,我是Symfony的新手,我只有2周的时间练习该框架.那么让我们谈谈我的真正问题.概要很简单,我有一个非常简单的形式,我用来创建一个类别(CD/DVD /书籍等).通常情况下,我的页面会显示已存在的所有类别,并且我输入了一个新的类别(如BLU-RAY for ie),然后该类别将保存在名为Categorie的数据库中,并带有这些属性(idcategorie = BLU-RAY,idcatalogue = CAT01) .

这是正常的情况,在我的情况下,我可以列出所有类别列表,但当我提交我的表格,我有一个美丽

在链配置的命名空间SEBO\BackOfficeBundle\Entity中找不到类'Doctrine\ORM\EntityRepository'

首先是我的控制器

public function categorieAction(Request $request)
{
    $categorie = $this->getDoctrine()
        ->getRepository('SEBOBackOfficeBundle:Categorie');
    $listeCategorie = $categorie->findAll();

    $newCategorie = new Categorie();
    $newCategorie->setIdcatalogue('CAT01');

    $form = $this->createFormBuilder($newCategorie)
        ->add('idcategorie', 'text')
        ->add('Ajouter', 'submit')
        ->getForm();

    $form->handleRequest($request);

    if ($form->isValid()) {
        $em = $this->getDoctrine()->getManager();
        $em->persist($categorie);
        $em->flush();

        $request->getSession()->getFlashBag()->add('notice', 'Catégorie bien enregistrée.');

        return $this->redirect($this->generateUrl('sebo_back_office_categorie', array(
            'listeCategorie' => $listeCategorie,
            'form' => $form->createView(),
        )));
    }

    $content = $this->get('templating')->render('SEBOBackOfficeBundle:Advert:categorie.html.twig', array(
        'listeCategorie' => $listeCategorie,
        'form' => $form->createView()
    ));
    return new Response($content);
}
Run Code Online (Sandbox Code Playgroud)

这是我的类Categorie.php

namespace …
Run Code Online (Sandbox Code Playgroud)

php orm symfony doctrine-orm

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

在 Spring 中使用带有 WebServiceGatewaySupport 的 SOAP 1.2

我对 Spring 框架很陌生,我在用 Spring 创建一个简单的 SOAP 客户端时遇到了一些问题。

像一个好新手一样,我使用 Spring 教程来制作我的 SOAP 客户端。你可以在这里找到它 -> https://spring.io/guides/gs/sumption-web-service/

使用示例中给出的 Web 服务进行测试是可以的。我已经更改了代码以使其与我的 Web 服务一起使用,因此文件如下:

设置代码引脚配置.java

package hello;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;

@Configuration
public class SetPinCodeConfiguration {

@Bean
public Jaxb2Marshaller marshaller() {
    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    // this package must match the package in the <generatePackage> specified in
    // pom.xml
    marshaller.setContextPath("hello.wsdl");
    return marshaller;
}

@Bean
public SetPinCodeClient SetPinCodeClient(Jaxb2Marshaller marshaller) {
    SetPinCodeClient client = new SetPinCodeClient();
    client.setDefaultUri("http://xxx.xxx.xx.x/PlayerServices/PlayerIntelligence/PlayerManagementService");
    client.setMarshaller(marshaller);
    client.setUnmarshaller(marshaller);
    return client;
}
}
Run Code Online (Sandbox Code Playgroud)

设置密码客户端.java …

java spring soap web-services

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

标签 统计

c# ×1

datagridview ×1

doctrine-orm ×1

java ×1

linq ×1

orm ×1

php ×1

soap ×1

spring ×1

sql-server ×1

symfony ×1

web-services ×1