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. spring通过注解依赖注入和获取xml配置混合的方式

    spring的xml配置文件中某个<bean></bean>中的property的用法是什么样的? /spring-beans/src/test/java/org/spring ...

  2. php获取某个目录下面文件的内容

    if(!defined('PATH'))define('PATH', dirname(dirname(__FILE__)).'/');ini_set ( 'include_path', '.:' . ...

  3. ssh key报but this does not map back to the address – POSSIBLE BREAK-IN ATTEMPT!错误

    在/etc/hosts 文件加上对方的主机名  ip地址,可以ping通主机名即可.

  4. Struts2 处理表单重复提交

    * 在表单页面中增加一个隐藏域:<s:token></s:token>(需要在表单内)        * 创建一个struts.xml的配置文件,具体配置如下:         ...

  5. 学习OpenSeadragon之一(一个显示多层图片的开源JS库)

    OpenSeadragon是一个可以显示多层图片(可放大缩小)的Web库,基于JavaScript,支持桌面和手机. 由于我项目需要,却没有找到任何中文教程,因此在官网上一边学习,一边总结于此. 官网 ...

  6. jquery mobile 复选框和单选框

    checkbox 和radio <!DOCTYPE html> <html> <head> <meta charset="utf-8"&g ...

  7. Notepad++ Java开发环境配置

    1. 安装JDK 下载JDK 6下载 http://developers.sun.com.cn/download/java_se.html 运行安装程序,按照屏幕提示完成JDK 6的安装,下面为安装路 ...

  8. 刷入临时recovery

    @echo off @echo 手机进 Fastboot 模式 fastboot.exe boot recovery.img @echo. @echo 等待手机进入临时REC pause echo o ...

  9. 完全教程 Aircrack-ng来PJ---WEP、WPA-PSK--加密利器

    恩,先说明一下,本章的内容适用于目前市面所有主流品牌无线路由器或AP如Linksys.Dlink.TPLink.BelKin等.涉及内容包括了WEP加密及WPA-PSK加密的无线网络的破解操作实战. ...

  10. 转:SRIO错误侦测和管理机制

    http://www.deyisupport.com/question_answer/dsp_arm/c6000_multicore/f/53/t/22879.aspx http://www.deyi ...