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 :)