如何从数据库中的逗号中断字符串并在Radiobuttonlist中显示单词? [英] How Do I Break String From Comma In Database And Display the words In Radiobuttonlist?

查看:124
本文介绍了如何从数据库中的逗号中断字符串并在Radiobuttonlist中显示单词?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中有一个列,用逗号保存字符串,我需要将它们分开并显示在radiobuttonlist中。请帮助meeee

解决方案

首先,'带逗号的字符串'不应该存储在同一列中,这是一个很大的错误,这是违反关系数据库设计中的第一范式规则。有一篇关于这个 11条重要数据库设计规则的文章很好按照 [ ^ ]。您可以向谷歌询问有关关系数据库设计和相关事宜的更多信息。



回答您的问题:从数据库中检索带逗号的字符串之后:

要分隔字符串,请调整此拆分 [ ^ ]

要显示radiobuttonlist中的项目,请查看 RadioButtonList [ ^ ]

I have a column in database which saves a string with commas and i need to separate them and display in radiobuttonlist. Please help meeee

解决方案

First of all, 'string with commas' should not have been stored in the same column, that is a big mistake, that is a violation of "first normal form" rule in relational database design. There is a good article on this 11 important database designing rules which I follow[^]. You can ask google for more information on relational database design and related matters.

To answer your question: after retrieving the 'string with commas' from your database:
To separate the string,, adapt this Split[^]
To display items in radiobuttonlist, check this out RadioButtonList[^]


这篇关于如何从数据库中的逗号中断字符串并在Radiobuttonlist中显示单词?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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