繁体   English   中英

SQL Server 2008,asp.net MVC 3 C#当该值为null时,将数据从一个表转移到另一个表。 。 另一个表中的数据开始

[英]SQL Server 2008 , asp.net MVC 3 C# Getting Data from one table to another when the value is null . . the data in the other table kicks in

var applicantList = (from a in context.Profiles
                             join app in context.APPLICANTs
                                 on a.PROFILE_ID equals app.Profile_id
                             where app.Profile_id == a.PROFILE_ID
                             select app).Take(1000);

这是声明,但我需要更改它。

我需要找到当申请人表上姓氏和名字字段的值为空时如何从“个人档案”表中获取值

在申请人表中。 有一个外键Profile_id。

谢谢谁能帮助我。

var applicantList = (from a in context.Profiles
    join app in context.APPLICANTs
    on a.PROFILE_ID equals app.Profile_id
    where app.LastName == NULL & app.Firstname == NULL
    select a).Take(1000);

如果将Asp.net mvc3与c#一起使用,则运算符应类似于&&。

var applicantList = (from a in context.Profiles
    join app in context.APPLICANTs
    on a.PROFILE_ID equals app.Profile_id
    where app.LastName == NULL && app.Firstname == NULL
    select a).Take(1000); 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM