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 ...
随机推荐
- NYOJ-129 并查集
这个题基本上是并查集稍微一变, 只是加了一些判断条件而已,就是将点合并成树, 最后遍历一下, 统计一下有多少棵树, 如果不是1的话, 肯定不是树,所以,可以根据这个来判断 #include <s ...
- css04使用外部样式
1.创建一个新的html页面 <!DOCTYPE html> <html> <head lang="en"> <meta charset= ...
- DataGrid 使用模型列后实现点击列名称排序
DataGrid 使用模型列后实现点击列名称排序 代码如下: <DataGridTemplateColumn Header="型 号" SortMemberPath=&quo ...
- JSP验证码
ImageServlet.java package cn.hist.test.servlet; import java.awt.Color; import java.awt.Font; import ...
- Winamp传统外观皮肤MusicRio发放
这款皮肤是我在2002年自己弄的,如果能给还在使用Winamp的朋友使用那就最好了. 下载地址:http://files.cnblogs.com/lzhdim/MusicRio.rar
- egrep和grep有什么区别
grep默认不支持正则表达式,egrep默认支持正则表达式,egrep 等于 grep -E 命令.
- Win8节省C盘空间攻略
问题分析: 1.系统页面文件(虚拟内存)占用空间 2.自动更新的缓存文件 3.系统保护的备份文件(系统还原用的) 4.休眠文件 5.索引文件 6.桌面文件 解决办法: 1.机器是8G内存,完全不需要虚 ...
- iOS8中添加的extensions总结(四)——Action扩展
Action扩展 注:此教程来源于http://www.raywenderlich.com的<iOS8 by Tutorials> 1.准备 本次教程利用网站bitly.com进行 bit ...
- [转]链接分析算法之:主题敏感PageRank
原文引自:http://blog.csdn.net/hguisu/article/details/8005192,感谢 前面的讨论提到.PageRank忽略了主题相关性,导致结果的相关性和主题性降低, ...
- CentOS+nginx+uwsgi+Python 多站点环境搭建
转载:http://www.cnblogs.com/xiongpq/p/3381069.html 环境: CentOS X64 6.5 nginx 1.5.6 Python 2.7.5 正文: 一:安 ...