gpt4 book ai didi

c# - SQL bool 属性和 ASP.NET

转载 作者:太空宇宙 更新时间:2023-11-03 19:31:47 24 4
gpt4 key购买 nike

我的 SQL 表中有一列,我想创建一个 bool 属性,但没有,所以我将其设为 int 并使用 1 表示是,0 表示否。有没有一种方法可以将下拉列表添加到包含 Yes 和 No 值的 visual studio 中的 ListView ?

基本上我可以将列绑定(bind)到下拉列表,而不是在更新记录时用户可以选择是或否而不是输入 1 或 0?

最佳答案

Essentially so I can Bind the column to the dropdown, rather than when updating the record the user can select Yes or No rather than enter 1 or 0?

<asp:DropDownList ID="ddl" runat="server"> 
<asp:ListItem Text="Yes" Value="1" />
<asp:ListItem Text="No" Value="0" />
</asp:DropDownList>

关于c# - SQL bool 属性和 ASP.NET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4433789/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com