Dapper a table field is empty when you query multiple tables

Source: Internet
Author: User

Recently in learning to use dapper Baidu has a detailed use of the tutorial, in the Multi-table query, the following situation occurs.

The SQL used is as follows,

 1  select  *  2  from  [  student  ]   As   A  3  inner  join   [ junior  ]  as  B on  b.id=  a.juniorid 

Then I thought it was my own mistake, and found a lot of places not to find the reason. Then I found the big God. The article on dapper about the Spliton concept, which tells the description of how the dapper Gets the entity (as shown in the following figure), only to know that there might be a problem with the field order.

I then found the last column of ID, because the ID was not set when the table was created, and then the column was deleted and then reused the "ALTER TABLE table add column int IDENTITY (first) not NULL" new self-increment column.

The query condition is then given the following results to solve the problem.

1 SELECT  2 from[Student] as A3  InnerJOIN[Junior] as on b.id=A . Juniorid

This question is indeed relatively simple, appeared when looking for a long time, record down also give oneself a reminder.

Reference links in this article:

Https://ithelp.ithome.com.tw/articles/10198210?sc=rss.qu

Https://www.cnblogs.com/huangxincheng/p/5832281.html

Dapper a table field is empty when you query multiple tables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.