Imports System.Data.SqlClient Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim coon As New SqlConnection = "data source = DESKTOP-S0KOBIU ; initial catalog= frist; Integrated Security=True" Dim da As New SqlDataAdapter Dim dt As New DataTable da = New SqlDataAdapter("select * from info", coon) da.Fill(dt) DataGridView1.DataSource = dt End Sub End Class
<pre>Imports System.Data.SqlClient Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim coon As New SqlConnection = ("data source = DESKTOP-S0KOBIU ; initial catalog= frist; Integrated Security=True") Dim da As New SqlDataAdapter Dim dt As New DataTable da = New SqlDataAdapter("select * from info", coon) da.Fill(dt) DataGridView1.DataSource = dt End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)