简体   繁体   English

带有DDL的ASPX DetailsView更新为SQL问题

[英]ASPX DetailsView with DDL update to SQL Issue

Trying to find out if I am approaching this right (NOOB so be patient plz!) I'm trying to write a single aspx page with UserList1 (bind to SQLSource1.displayname) which updates DetailsView1 (Edit Enabled, SQLSource2 where displayname=@displayname). 试图找出我是否正在接近这个权利(NOOB,请耐心等待!),我试图用UserList1(绑定到SQLSource1.displayname)编写一个aspx页面,该页面更新DetailsView1(启用Edit,SQLSource2,其中displayname = @ displayname )。 Display name and Dept fields are read-only, yesno needs to updated. 显示名称和部门字段是只读的,不需要更新。 If I leave the stock edit textbox it updates fine. 如果我离开股票编辑文本框,它会更新正常。 End users being end users we want to give them limited options for the update so I want to replace the textbox with a DDL ... Change YESNO field templatefield, add DDL which has YES or NO option, Postback=enabled. 最终用户是最终用户,我们希望为他们提供有限的更新选项,因此我想用DDL替换文本框...更改YESNO字段templatefield,添加具有YES或NO选项的DDL,启用Postback =启用。

Unbound I get "Cannot insert the value NULL into column 'yesno' .... 未绑定,我得到“无法将值NULL插入列'yesno'...。

Bind("yesno") I get "Conversion from string "YES" to type 'Integer' is not valid" Bind(“ yesno”)我收到“从字符串“ YES”到类型“ Integer”的转换无效”

1st error - I probably need to catch the selected text of the DDL selection to do the update statement ?? 第一个错误-我可能需要捕获DDL选择的选定文本来执行更新语句? Code behind or Javascript/Jquery? 代码落后还是Javascript / Jquery?

2nd error - why is converting the selection to Integer - SQL column type is text? 第二个错误-为什么将选择转换为整数-SQL列类型为text?

TIA Guys ! TIA伙计们!

  1. 数据库中的yesno列不允许为空

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM