Advertisement
sciexie

search data ggrid

Mar 9th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Private Sub Product_info_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. connect = New OdbcConnection("driver=MySQL ODBC 5.3 ANSI Driver;localhost;port=3306;UID='root';pwd=;database=dummy_db")
  3. connect.Open()
  4.  
  5. Dim myCmd1 As New OdbcCommand("select * from product_tbl", connect)
  6. Dim da As New OdbcDataAdapter(myCmd1)
  7. Dim ds As New Data.DataSet
  8.  
  9. da.Fill(ds, "prouct_tbl")
  10.  
  11. DataGridView1.DataSource = ds.tables(0)
  12. DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
  13. DataGridView1.RowHeadersDefaultCellStyle.BackColor = Drawing.Color.Aqua
  14. DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Drawing.Color.DarkBlue
  15. DataGridView1.Refresh()
  16.  
  17. Button3.Enabled = False
  18. Button4.Enabled = False
  19. Button2.Enabled = False
  20.  
  21. TextBox2.Focus()
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement