ComboBox1 ADD DATA
Dim dt As New DataTable
Dim Sql As String
ComboBox1.DataSource = Nothing
ComboBox1.Items.Clear()
ComboBox1.Items.Remove(ComboBox1.DisplayMember)
Sql = "select distinct b.ctnsplno from TBD_recbody b inner join TBD_partlg l on b.datpartno = l.datpartno inner join TBD_recent e on e.ctnsplno = b.ctnsplno where b.planqty <> b.recqty and e.type <> 'R'"
dt = ssCON.Exc_Reader(Sql)
Dim i = 0
If dt.Rows.Count > 0 Then
For Each r1 In dt.Rows
ComboBox1.Items.Add(dt.Rows(i)("ctnsplno").ToString())
i = i + 1
Next r1
End If
If ComboBox1.Items.Count > 0 Then
ComboBox1.SelectedIndex = 0 ' The first item has index 0 '
End If
ComboBox1.SelectedIndex = 0 ----
ComboBox1 ADD DATA น๊ะจ๊ะ
Dim Sql As String
ComboBox1.DataSource = Nothing
ComboBox1.Items.Clear()
ComboBox1.Items.Remove(ComboBox1.DisplayMember)
Sql = "select distinct b.ctnsplno from TBD_recbody b inner join TBD_partlg l on b.datpartno = l.datpartno inner join TBD_recent e on e.ctnsplno = b.ctnsplno where b.planqty <> b.recqty and e.type <> 'R'"
dt = ssCON.Exc_Reader(Sql)
Dim i = 0
If dt.Rows.Count > 0 Then
For Each r1 In dt.Rows
ComboBox1.Items.Add(dt.Rows(i)("ctnsplno").ToString())
i = i + 1
Next r1
End If
If ComboBox1.Items.Count > 0 Then
ComboBox1.SelectedIndex = 0 ' The first item has index 0 '
End If
ComboBox1.SelectedIndex = 0 ----
ComboBox1 ADD DATA น๊ะจ๊ะ
ไม่มีความคิดเห็น