如何显示数据库中带有逗号的数据 [英] how to display data that has comma from database

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

问题描述

例如这样的sql表:

任务图片状态
开发wti,zmr 90%完成的系统

我想在gridview中显示数据.当前,当我在文本框中输入wti或zmr时,没有数据显示.由于任务是由两个人开发的,因此每当我键入wti或zmr时都应显示.
帮我解决这个问题.我坚持了两天.

musiw

for instance sql table like this:

task pic status
develop system wti,zmr 90%done

i want to display the data in gridview.currently when i type in textbox wti or zmr no data is display.it should be display whenever i type wti or zmr since the task is developed by two person.

help me on this.i stuck on this for two days.

musiw

推荐答案

,您需要执行第一个标准 [ ^ ] ...

you need to do a SQL Substring search[^]

You may want to look at changing the way you''ve designed your table and make it first normal[^] ...

<br />
Table Tasks<br />
id    Title               Percent<br />
1     ''develop system''      90<br />
2     ''test system''         10<br />
<br />
Table Users<br />
id    User<br />
1     ''wti''<br />
2    ''zmr''<br />
3     ''musiw''<br />
<br />
Table Task_Users<br />
id    task     user<br />
1     1        1<br />
2     1        2<br />
3     2        1<br />
4     2        2<br />
5     2        3<br />
<br />


这篇关于如何显示数据库中带有逗号的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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