如何在asp.net中拆分数据 [英] How to split data in asp.net

查看:79
本文介绍了如何在asp.net中拆分数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



以下来自数据库的数据在一行中。我需要在dropdownlist.one之后获取这些数据。就像这样,



美国邮政(9.50)

头等舱邮件(加拿大)(15.00)

航空邮件(国际地址)(26.00)

次日空气(16.00 + 28.66 = 44.66)等..







美国邮政( 9.50)头等舱邮件(加拿大)(15.00)航空邮件(国际地址)(26.00)次日航空(16.00 + 28.66 = 44.66)UPS第2天(11.00 + 17.44 = 28.44)UPS地面(10 + 9.29 = 19.29)UPS NEXT DAY AIR(10.00 + 17.44 = 27.44)







请帮我查询。

谢谢

Hi,
Below data coming from database in one line.I need to get this data in a dropdownlist.one after the other .like this,

US Mail (9.50)
First Class Mail (Canada) (15.00)
Airmail (International Addresses) (26.00)
Next Day Air (16.00 + 28.66 = 44.66) etc..



US Mail (9.50) First Class Mail (Canada) (15.00) Airmail (International Addresses) (26.00) Next Day Air (16.00 + 28.66 = 44.66) UPS 2ND Day (11.00 + 17.44 = 28.44) UPS Ground (10 + 9.29 = 19.29) UPS NEXT DAY AIR (10.00 + 17.44 = 27.44)



Please help me with the query.
Thanks

推荐答案

如果你把它作为一行提取出来,用你问题底部显示的格式,你就做不到了它是自动的 - 没有任何区别标志着一个选项的结束和另一个选项的开头。如果您使用特殊字符(例如|)很容易:

If you are extracting that as one line, in the format shown at the bottom of your question, then you can't do it automatically - there is nothing distinct which marks the "end" of one option and teh beginning of another. It easy if you use a special character such as '|':
US Mail (9.50)|First Class Mail (Canada) (15.00)|Airmail (International Addresses) (26.00)|Next Day Air (16.00 + 28.66 = 44.66)|UPS 2ND Day (11.00 + 17.44 = 28.44)|UPS Ground (10 + 9.29 = 19.29)|UPS NEXT DAY AIR (10.00 + 17.44 = 27.44)

因为那样你就可以在SQL或C#/ VB代码中轻松拆分字符串。但如果没有......那就没有太多可以继续了。

because then you can split the string easily, either in SQL or in your C# / VB code. But without that...there isn't a lot to go on.


这篇关于如何在asp.net中拆分数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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