VB.net帮助将数据插入到新表中 [英] VB.net Help while inserting data into New table

查看:167
本文介绍了VB.net帮助将数据插入到新表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将数据插入到SQL DB(数据库。表中不包含任何数据,它;一个新插入。我的表中有一个自动生成列。基于插入时我使用自动生成列值在插入时向另一列添加+1。但我在UI中遇到错误:

无法将null值分配给类型为System.Decimal的成员,这是一种不可为空的值类型。

I tried to insert data into SQL DB (database. Table doesn't contain any data, It;s a fresh insert. there is a auto generate column in my table. based on that while inserting I use auto generate column value to add +1 to another column while inserting. But I am getting error in UI :
"The null value cannot be assigned to a member with type System.Decimal which is a non-nullable value type."

推荐答案

在插入完整(必需)行数据之前,不能使用自动生成列值。



当在数据库中成功执行插入查询时,会生成自动生成列值。



这就是为什么它为您所需的十进制列提供Null值的原因。 />


检查并告诉我......:)
You can not use auto generate column value before inserting complete(Required) row data.

auto generate column value is generated, when there is an insert query executes successfully at database.

thats why it is supplying Null value to your surly required decimal column.

check it and let me know... :)


不错



祝你好运

快乐编码:)
nice

wish you good luck
happy coding :)


这篇关于VB.net帮助将数据插入到新表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆