Guest User

Untitled

a guest
Nov 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. 'create a connection string named con
  2.  
  3. Public sub MyForm_Load
  4.  
  5. Dim cmd as new OleDbCommand("Select * from [table name here-avoid brackets
  6. if required]",con)
  7.  
  8. Dim adapter as new OleDbDataadapter(cmd)
  9.  
  10. Dim table as new datatable
  11.  
  12. adapter.fill(table)
  13.  
  14. ComboBox1.DataSource = table
  15. ComboBox1.DisplayMember = table.Columns(3).ToString 'you can use column name or even row
  16.  
  17. Public Sub ComboBox1_IndexChanged
  18.  
  19. Textbox1.tex=Combobox1.text
Add Comment
Please, Sign In to add comment