如何将默认的constrint值以及manuall更新值设置为linq to sql?

编程入门 行业动态 更新时间:2024-10-09 00:42:37
本文介绍了如何将默认的constrint值以及manuall更新值设置为linq to sql?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Hii, 之前我有桌子,我设置了一个默认的constrint到我的一个专栏。 所以,如果没有在linq类中提供,那么默认设置为null,即使我在sql表中将我的默认值设置为4, 然后我从dbml中设置该列的属性,将auto autorate设置为true ..它正在工作.. now问题是..从其他方法,当我尝试为该列提供一些其他价值... 它投掷了错误.. 由数据库计算或生成的成员无法更改。 i want在不提供时使用默认值,并且在提供时我的值应该更新

Hii, Previously i had table and i set a default constrint to one of my column . so , if not provided in linq class , then null was setting by default even though i set my default value to 4 in sql table, Then i chnaged the property of that column from dbml , Set autogenrate to true .. and it was working.. now the problem is .. from other method when i try to give some other value for that column ... it is throwing an error .. A member that is computed or generated by the database cannot be changed. i want to use default value when not prvided and my value when procvided it should get updated

推荐答案

更多推荐

如何将默认的constrint值以及manuall更新值设置为linq to sql?

本文发布于:2023-11-25 21:41:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631451.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设置为   如何将   constrint   manuall   linq

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!