Gridview中的DropDownList更新记录获取问题... [英] DropDownList in Gridview to update record getting problem...

查看:72
本文介绍了Gridview中的DropDownList更新记录获取问题...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dear all ,
I am working on gridview  and there are two dropdownlist in gridview edit template with respective sqldatasource.
what i want to do is update the record when i will click on update button which is generated through gridview
but it is throwing error :
=====
Cannot insert the value NULL into column 'CompanyID', table 'RealValue.dbo.tbl_BikePrcInfo'; column does not allow nulls. UPDATE fails.
The statement has been terminated.
 ======
please help me

Thanks in adv.......

推荐答案

此错误是因为,当我们单击更新"按钮时,我们没有得到DorpdownList SelectedValue. .它向我们返回NULL.这就是为什么它显示以下错误.

无法将值NULL插入表"RealValue.dbo.tbl_BikePrcInfo"的"CompanyID"列中;列不允许为空. UPDATE失败.

请调试您的代码并检查其值.
This error is because we are not getting the DorpdownList SelectedValue, when we click on the Update button. It returns NULL to us. That''s why it shows below error.

Cannot insert the value NULL into column ''CompanyID'', table ''RealValue.dbo.tbl_BikePrcInfo''; column does not allow nulls. UPDATE fails.

Please debug your code and check the values.


这篇关于Gridview中的DropDownList更新记录获取问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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