分隔文件我需要的是从逗号分隔文件中读取并从它们中检索ownley某些行到组合框,然后组合框必须ownley显示特定名称。我在我正在寻找的内容下方添加了一个数据库工作代码,但在使用数据库时,我需要逗号分隔文件的代码。
Imports System.Data.SqlClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call combo1()
End Sub
Sub combo1()
Dim com As SqlConnection
com = New SqlConnection("Server = Q-DESIGN\SQLEXPRESS; Database = Q-Design Test Results; Trusted_Connection = true;")
com.Open()
Dim command As SqlCommand = New SqlCommand("SELECT DISTINCT(Testname) from URL", com)
Dim reader As SqlDataReader = command.ExecuteReader()
While reader.Read()
ComboBox1.Items.Add(reader.GetString(0))
End While
reader.Close()
com.Dispose()
com.Close()
End Sub
我的逗号分隔文件将为 egsample 包含以下几行
Jenny, 25, Female
Micheal, 100, Female
shaun, 50, male
Cindy, 75, Female
Cindy, 30, Female
Cindy, 20, Female
Micheal, 30, Female
deric, 50, Male
我需要组合框来显示每个名字,ownley 一次