I want to use DataGridView like GridView in ASP.net.
I draged the toolbox DataGridview to the Form.
I linked it with my database.
How do I get a printout of table1 on the Form1?
My connection string works.
I draged the toolbox DataGridview to the Form.
I linked it with my database.
How do I get a printout of table1 on the Form1?
My connection string works.
Code:
Using conn As New SqlConnection(connStr)
conn.Open()
Using sqlDA As New SqlDataAdapter("SELECT * FROM [table1];", conn)
Dim dt As New DataTable()
sqlDA.Fill(dt)
sqlDA.Dispose()
End Using
End Using