Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Data
- Imports System.Data.OleDb
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=peliculas.mdb; User Id=admin;Password=;")
- Dim da As New OleDbDataAdapter("SELECT * FROM Peliculas", cnn)
- Dim ds As New DataSet
- da.Fill(ds)
- DataGridView1.DataSource = ds.Tables(0)
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim r As Integer
- For r = 0 To DataGridView1.Rows.Count - 1 Step 2
- DataGridView1.Rows(r).DefaultCellStyle.BackColor = Color.Pink
- Next
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- ' Solo la primer columna
- DataGridView1.Columns(0).DefaultCellStyle.BackColor = Color.Yellow
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- DataGridView1.BackgroundColor = Color.Crimson
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- End
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement