将Asp.net checkboxlist中的多个值插入数据库表 [英] Inserting multiple values from Asp.net checkboxlist into a database table

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

问题描述

大家好,我以前从未使用过复选框列表因此我不知道如何使用它。现在我需要将它包含在我的应用程序中。我在sql server 2008 express中有一个表。该表从Web表单控件获取值,即radiobuttonlists和文本框。现在,用户希望我添加一个复选框列表,因为他们想要选择更多选项。



问题是我需要添加多少列到将关联的表中使用复选框列表,以及如何将数据检索回复选框列表以查看所选内容。



我搜索但没有给出具体示例或解释

Hi all, i have never used a checkbox list before hence i dont know how to work with it. Now am in a situation whereby i need to include it in my application. I have a table in sql server 2008 express. The table gets values from web form controls namely radiobuttonlists and textboxes. Now the users want me to add a checkboxlist because they want to select more options.

The question is how many columns do i need to add to the table that will associate with the checkboxlist, and how will i retrieve the data back to checkboxlist to what was selected.

I have searched but no concrete example or explanation is given

推荐答案

为此创建一个表来存储所选的复选框值和用户的唯一ID。

将用户的唯一ID和值插入DB(插入通过BL中的循环将值赋入DB或将逗号分隔值发送到SP并使其工作)。



用于将数据检索回复选框。 />
获取所选的复选框值并根据值进行检查



我认为它可以帮到你
Create a table for this to store the selected check box values and user's unique id.
Insert user's unique id and the values to the DB (insert values into DB through the loop in BL or send the comma separated values to the SP and make it work).

For retrieving data back to the check box.
fetch the selected check box value and checked it based on the value

I think it may help you


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

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