用VB.net格式多表完成SQL表 [英] Multi-completion of SQL table with VB.net form

查看:75
本文介绍了用VB.net格式多表完成SQL表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!,


我正在尝试创建一个项目,这样我就有机会在SQL服务器上重新填充表格。该表已创建,并且有多个列。我搜索了互联网,但没有找到我正在寻找的解决方案。也许,我先解释一下我的表格会做什么(应该怎么做)



输入表格的用户有义务完成几个字段。 (1控件是Textbox(单值),所有其他控件都是TextBox.Multiline。

每个控件都会将数据保存到SQL表中。这就是如何处理它的问题,用户填写第一个文本框(单值)后用数据填充(假设这是一个标识他居住国家的值 - 波兰),他会将数据放到第二个文本框(多个)中,称为城市(并举例说明6个例子 - 华沙​​,卡托维兹,弗罗茨瓦夫,克拉克?W,格但斯克,格丁尼亚)可以选择将它保存在SQL表格中:



<前lang =文本>国家城市
波兰华沙
波兰卡托维兹
波兰弗罗茨瓦夫
波兰克拉科夫
波兰格但斯克
波兰格丁尼亚





我希望有一个解决方案不仅可以节省价值 - 波兰到列中的第一个空单元格只有金额,任何用户增加值textboxie 2当然,有几个testbox?w喜欢t他在我的表格 - 只有六个,但重点是我希望可以选择对用户X输入的数据进行排序,得到Y国家,只显示与文本框中的这些变量关联的数据(单个) )。



我希望我解释得恰到好处....

最好的问候

M

解决方案

不确定我是否完全遵循,但听起来你只是试图获取多行文本框的行并存储它们。



 对于 每个 Str 作为 字符串   .TextBox2.Lines 
MsgBox(Str)
下一步





如果你有国家在说textbox1那么你可以使用



 对于 每个 Str 作为  String    Me  .TextBox2.Lines 
MsgBox(TextBox1。文字& Str)
下一步





当然用你的替换msgbox记录来源。


Hi everyone!,

I'm trying to create a project, so that I will have the opportunity to refill the table on SQL server. The table is created and it has several columns. I searched the internet, but did not come across to the the solution I'm looking for. Maybe, I will explain first what would my form do (how should it be)

The user entered the form is oblige to completed several fields. (1 control is Textbox (single value), all other controls are TextBox.Multiline.
Each of them would save the data to a SQL table. And here comes the question of how to do to it, after filling the first textbox (which is single.value) with data by the user (let's say this is one value that identifies the country in which he lives - Poland), he will put the data to the second textbox (multiple) called"Cities" (and gives for example 6 examples - Warsaw, Katowice, Wrocław, Krak?w, Gdańsk, Gdynia) had the option to save it in a SQL table like that:

Country    Cities
Poland     Warsaw
Poland     Katowice
Poland     Wroclaw
Poland     Krakow
Polish     Gdańsk
Poland     Gdynia



I hope there is a solution that will not only save the value - Poland to the first empty cell in the column to only the amount, to any user adds value textboxie 2 Of course, there are a few testbox?w like this on my form - just six, but the point is that I would like to have the option of sorting the data entered by the user X, got Y the country, showing only the data that are associated with these variables from textbox one (single).

I hope I explained it properly....
Best Regards
M

解决方案

Not sure I am following exactly, but is sounds like you are just trying to get the lines of a multi-line textbox and store them.

For Each Str As String In Me.TextBox2.Lines
            MsgBox(Str)
 Next



If you have country in say textbox1 then you can use

For Each Str As String In Me.TextBox2.Lines
           MsgBox(TextBox1.Text & Str)
Next



Replacing msgbox of course with your record source.


这篇关于用VB.net格式多表完成SQL表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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