Problem with generating association inside dbml file for LINQ to SQL
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的更多相关文章
- Update files embedded inside CAB file.
References: https://community.flexerasoftware.com/showthread.php?182791-Replace-a-single-file-embedd ...
- vs2019里没有linq to sql或EF工具,导致dbml或者edmx无法通过设计器浏览
点击:工具->获取工具或功能 选择需要安装的工具,然后点击底部的修改按钮就可以了,等待安装完成,如下图:
- Windows Phone本地数据库(SQLCE):5、[Association]attribute(翻译)(转)
这是“windows phone mango本地数据库(sqlce)”系列短片文章的第五篇. 为了让你开始在Windows Phone Mango中使用数据库,这一系列短片文章将覆盖所有你需要知道的知 ...
- Extension of write anywhere file system layout
A file system layout apportions an underlying physical volume into one or more virtual volumes (vvol ...
- 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 ...
- 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: ...
- 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 ...
- 《DSP using MATLAB》Problem 2.14
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 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 ...
随机推荐
- 比较好的总结runtime
http://www.cocoachina.com/ios/20160128/15154.html
- iptables 下开放ftp
这两天在给客户安装服务器时也顺便给他们使用iptables,不用不知道,一用才发现iptables还有很多东西可以学的,比如开放ftp.iptables 的filter表的INPUT链的默认策略设为了 ...
- libthrift0.9.0解析(二)之TSimpleServer
TSimpleServer简单实现Tserver,代码如下. /** * Simple singlethreaded server for testing. * */ public class TSi ...
- 小学生之解析XML应用
1.什么是XML? 解析:XML:Extensible Markup Language(可扩展标记语言) HTML:HyperLink Text Markup Language(超文本标记语言) ...
- 总结:如何获取同一个DIV里的多个不同子标签的值,并赋值给input?
这个问题说起来简单,但对于新手来说,也着实卡了好久,并且我在网上搜了好久没能找到合适的答案, 于是去博问问了一下,得到许多大神们的帮助与回答,接下来我就总结一下能够实现这个效果的几种方法,既为了自己更 ...
- swing——JFrame基本操作
用JFrame(String String1)创建一个窗口 public void setBounds(int a,int b,int width,int height)设置窗口初始化的位置(a,b) ...
- QT5-控件-QLabel和QLCDNumber-标签显示图片或者视频,LCD用于上位机不错
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QLabel> #incl ...
- 【回忆1314】抽奖之Flash大转盘
1.搭建JS与Flash互通的环境 function thisMovie(movieName){ if (window.document[movieName]) { return window.doc ...
- php中文匹配
PHP判断字符串中是否含有中文 <? $str = "测试中文"; echo $str; echo "<hr>"; //if (preg_ma ...
- 【行为型】Interpreter模式
解释器模式意图为给定的语言定义其文法表示,同时定义该文法表示的一套解释器来解释语言中的句子.该模式说的简单通俗点,其主要用途是用来解释用的.至于解释什么,则要看具体的上下文环境.我们可以为一个表达式专 ...