【发布时间】:2018-02-14 18:32:54
【问题描述】:
这个问题与我之前的问题有关
我目前正在制作一个注册表单,其中学生的所有详细信息都保存在一个文本文件中。
我使用文本文件填充了组合框。
这些值的格式例如:(code~school name) SCH001~Saint 托马斯学院
这就是我将详细信息保存在文本文件中的方式:
Dim firstname, lastname, email, mobile, level, currentschool, currenttrack, institution1, institution2, institution3, institution4, institution5, institution6, courses1, courses2, courses3, macaddress, eventcode, idseq, filename, logfiledirectory, targetdirectory, log, configdir, printschool As String
firstname = txtFName.Text
lastname = txtLName.Text
email = txtEmail.Text
mobile = txtMobile.Text
level = cmbLevel.Text
currenttrack = cmbCurrentTrack.Text
printschool = cmbCurrentSchool.Text
currentschool = cmbCurrentSchool.SelectedValue
institution1 = cmbInstitution1.SelectedValue
institution2 = cmbInstitution2.SelectedValue
institution3 = cmbInstitution3.SelectedValue
institution4 = cmbInstitution4.SelectedValue
institution5 = cmbInstitution5.SelectedValue
institution6 = cmbInstitution6.SelectedValue
courses1 = cmbCourse1.SelectedValue
courses2 = cmbCourse2.SelectedValue
courses3 = cmbCourse3.SelectedValue
If mobile = "" Then
mobile = "09000000000"
End If
If firstname = "" Or lastname = "" Or email = "" Or level = "" Or currentschool = "" Or currenttrack = "" Then
MessageBox.Show("Please enter the required fields!", "Registration", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
我有一个数据网格视图,其中显示了文本文件中所有保存的详细信息。 这是我的数据网格视图的屏幕截图:
我想做什么:我想使用源文本文件(我用来填充组合框的那个)中的当前学校代码(参考图片)检索学校名称。我希望学校名称显示在 datagridview 中,而不是学校代码。 有没有可能的方法?
我希望你们明白我想说什么。 我是新来的。
【问题讨论】:
-
就是这么简单。在文本文件内容中搜索学校代码。得到线后,在'~'上分割线。现在我真的很想知道,你自己尝试了多少。正如我为前两个问题提供的答案一样。你现在可能已经学会了!
标签: vb.net visual-studio datagrid