如何使用一个可查询表的查询? [英] How can I make with one query for indexable table?
本文介绍了如何使用一个可查询表的查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有相同的表名,可转位,就像是
表1
表2
表3
表4
表5
我希望在vb.net中使用此命令,例如
i = 0到5
新SqlCommand(插入表(i)(Column1,Column2)值(1 ,2,3 ......)
下一页
如何才能实现这一目标循环更改表索引并保存不同的表格?
请帮忙。
什么我试过了:
请帮我解决这个问题,提前谢谢!
I have same table name with indexable, it's like
Table1
Table2
Table3
Table4
Table5
and I want to use this command in vb.net like
For i= 0 to 5
New SqlCommand("Insert into Table(i) (Column1,Column2) Values(1,2,3...)
Next
How is this possible to make this on every loop changing table index and saving different tables?
Pls. help this.
What I have tried:
Pls. help I need to solve this , Thanks in advance!
推荐答案
尝试:
Try:
Dim cmd As SqlCommand = SqlCommand("INSERT INTO TABLE" + i.ToString() + " Column1,Column2) VALUES(@C1, @C2)", connnection)
cmd.Parameters.AddWithValue("@C1", valuesForColumn1)
cmd.Parameters.AddWithValue("@C2", valuesForColumn2)
cmd.ExecuteNonQuery()
这篇关于如何使用一个可查询表的查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文