Here is my code, I'm wanting to fill a combobox from a column in an AS400 table:
Dim cn As iDB2Connection = New iDB2Connection("User ID=thegrinch;Password=elve
s;Data Source=1.1.1.1;Connection Timeout = 0")
Dim cmd As iDB2Command
Dim sqlstring As String
sqlstring = "select domtshowf from air400.domest where domastat = 'H'"
cn.Open()
cmd = New iDB2Command(sqlstring, cn)
Dim da As New iDB2DataAdapter(sqlstring,
cn)
Dim ds As New DataSet("FromShow")
Try
da.Fill(ds)
cboShowFrom.DataSource = ds.Tables(0)
Catch ex As Exception
MessageBox.Show(ex.ToStrin
g)
End Try
cn.Close()
Start Free Trial