想要将所有列值存储在一个列中 [英] want to store all column values in one column

查看:45
本文介绍了想要将所有列值存储在一个列中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有10个文本框class1,class2 .... class10就像这样
当在文本框中输入值时,它将被存储到数据库class1,class2..class10中.这没关系.然后我需要将所有10个值存储在一列(class0)中(20,21,22..29)谁能帮助我

i have 10 textboxes class1,class2....class10 like that
when in enter values in to textboxes it will be stored into database class1,class2..class10.this is ok. and then i need to store all 10 values in one column (class0) ( 20,21,22..29) can any one help me

推荐答案

假设您仅在一种表单上有10个文本框,您可以

assuming you only have 10 textboxes on one form you can either

Dim Str as string = ""

for each ctrl as control on form1.controls
 if typeof ctrl is textbox then
   if str.length = "" then
     str += ctrl.text
   else
     str += "," ctrl.text
   end
 end if
next







or

dim str as string = ""
str = textbox1.text & "," & textbox2.text & "," textbox3.text


这篇关于想要将所有列值存储在一个列中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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