Question:

I have created a dbml file in my project, and then dragged two tables from a database into the designer. This is the tables for order header and order lines, and order lines have a foreign key to order header to make it a one to many relationship.

As soon as the two tables are dragged onto the designer, the association arrow appear and everything looks correctly. In the properties for the association, Child Property is set to True, Access is public, Inheritance mode is (none), Name is OrderLines (originally taOrderLines, but edited by me to be called OrderLines.

The problem is that no OrderLines property is created. I checked manually in the generated cs file also, and neither the word OrderLines or Association is found there.

What am I doing wrong here?

Answer:

If your objects don't have a Primary Key property in the dbml, LinqToSql object tracking can't see those objects and relational properties will not be generated.

Problem with generating association inside dbml file for LINQ to SQL的更多相关文章

  1. Update files embedded inside CAB file.

    References: https://community.flexerasoftware.com/showthread.php?182791-Replace-a-single-file-embedd ...

  2. vs2019里没有linq to sql或EF工具,导致dbml或者edmx无法通过设计器浏览

    点击:工具->获取工具或功能 选择需要安装的工具,然后点击底部的修改按钮就可以了,等待安装完成,如下图:

  3. Windows Phone本地数据库(SQLCE):5、[Association]attribute(翻译)(转)

    这是“windows phone mango本地数据库(sqlce)”系列短片文章的第五篇. 为了让你开始在Windows Phone Mango中使用数据库,这一系列短片文章将覆盖所有你需要知道的知 ...

  4. Extension of write anywhere file system layout

    A file system layout apportions an underlying physical volume into one or more virtual volumes (vvol ...

  5. Unexpected exception 'Cannot run program ... error=2, No such file or directory' ... adb'

    Eclipse ADT Unexpected exception 'Cannot run program' up vote 8 down vote favorite 4 I have installe ...

  6. ogg12-ERROR OGG-01031 file D:\OGG\dirdat\ed000000 is not in any allowed output directories

    配置ogg时出现这个错误: 2018-01-04 14:22:58 ERROR OGG-01031 Oracle GoldenGate Capture for Oracle, P147148.prm: ...

  7. GoldenGate OGG-01032 There Is a Problem in Network Communication Error in Writing to Rmt Remote Trail Rmttrail (Doc ID 1446621.1)

    GoldenGate OGG-01032 There Is a Problem in Network Communication Error in Writing to Rmt Remote Trai ...

  8. 《DSP using MATLAB》Problem 2.14

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  9. Problem I. Increasing or Decreasing MIPT-2016 Pre-Finals Workshop, Taiwan NTU Contest, Sunday, March 27, 2016

    题面: Problem I. Increasing or DecreasingInput file: standard inputOutput file: standard outputTime li ...

随机推荐

  1. ListActivity ListView 使用 介绍 用法

    ListActivity简单的说就是ListView和Activity的结合,跟ListView和Activity组合实现的没有什么很大的差别,主要是比较方便. 在实现时,要注意: 1.一般情况,Li ...

  2. 像table一样布局div的CSS属性详解

    .equal {                     display:table;                     border-collapse:separate;margin: aut ...

  3. sublime开启php自动代码补全

    配置文件添加 "auto_complete_selector": "source, text", 配置文件打开方式:preferences->settin ...

  4. c 单链表反转(不添加新结点空间)

    最近复习考研,加上一直都将"算法"放在很高的位置,所以,蛮重视算法的.不多说了,其实这个问题,不难理解的. 主要代码: //反转单链表. void reverse(linklist ...

  5. iOS判断UIScrollView的滚动方向

    - (void) scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat newY = scrollView.contentOffset.y; ...

  6. 去掉eclipse上编辑时的提示

    用eclipse时,鼠标移到类上时会给出提示,如下图:

  7. 猜数字-js

    var n = Math.round(Math.random()*10); //随机数 // alert(n); while(true){ var Onum = prompt('请输入1-10之间的数 ...

  8. Java在ACM中的使用

    1.基本框架   import java.oi.*;   import java.util.*   public class Main   {   public static void main(St ...

  9. C程序设计语言练习题1-22

    练习1-22 编写一个程序,把较长的输入行”折“成短一些的两行或多行,折行的位置在输入行的第n列之前的最后一个非空格之后.要保证程序能够智能地处理输入行很长以及在制定的列前没有空格或制表符时的情况. ...

  10. 用c#在Access数据库中创建新表

    生成表NewTable,该表有文本字段Field1和整型字段Field2 private void CreateNewTable()  {    OleDbConnection conn = new ...