自分のプログラムに何が起こっているのかわかりません。(4) コードの結果をロードするのに 4 分かかりました。誰か理由を教えてもらえますか? この読み込みの問題を解決する方法を誰か教えてもらえますか?
これは私のコードです:
Imports System.Data.SqlClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim str As String = "Data Source=######;Initial Catalog=###;Persist Security Info=True;User ID=#####;Password=#####"
Dim con As New SqlConnection(str)
Dim cmd As String = "Select ControlNo,EmpNo,CheckOutDate,CheckOutTime,TaxiNo,PlateNo,Model,Make from dbo.ChkInOut"
Dim adpt As New SqlDataAdapter(com, con)
Dim myDataSet As New DataSet()
adpt.Fill(myDataSet, "dbo.ChkInOut")
Dim myDataTable As DataTable = myDataSet.Tables(0)
Dim tempRow As DataRow
For Each tempRow In myDataTable.Rows
'ListBox1.Items.Add((tempRow("ControlNo") & " (" & tempRow("EmpNo") & ")" & " (" & tempRow("CheckOutDate") & ")" & " (" & tempRow("CheckOutTime") & ")" & " (" & tempRow("TaxiNo") & ")" & " (" & tempRow("PlateNo") & ")" & " (" & tempRow("Model") & ")" & " (" & tempRow("Make") & ")"))
'ListBox1.Items.Add((tempRow("ControlNo") & " (" & tempRow("EmpNo") & ")"))
ListBox1.Items.Add(tempRow("ControlNo") & " " & tempRow("EmpNo") & " " & tempRow("CheckOutDate") & " " & tempRow("CheckOutTime") & " " & tempRow("TaxiNo") & " " & tempRow("PlateNo") & " " & tempRow("Model") & " " & tempRow("Make") & " ")
Next
End Sub
End Class