Results 1 to 3 of 3

Thread: Fill combobox with field in table

Threaded View

  1. #2
    Lively Member
    Join Date
    Feb 2001
    Location
    KL Malaysia
    Posts
    64
    Code:
    Dim objConn as New OleDbConnection(strDSN)
    Dim objCmd as New OleDbCommand(strSQL, objConn)
    Dim objReader as OleDbDataReader = objCmd.ExecuteReader
    
    While objReader.Read
        If Not IsDBNull(objReader.GetValue(0)) Then
            Combo1.Add(objReader.GetString(1))
        End If
    End While
    I think...

    Of course you must know the ordinal number of your column to assign the parameters on GetValue and GetString
    Last edited by weijian; Apr 28th, 2002 at 08:31 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width