2
Reply

What is the mistake in this coding? i can't able to execute the table........ Imports System.Data.SqlClient Imports System.Console Imports System.data Public Class Form1 Public conn As New SqlConnection Public com As New SqlCommand Public dap As New SqlDataAdapter Public ds As New DataSet Public dr As SqlDataReader Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ds = New DataSet conn.ConnectionString = "Data Source=PERSONAL\SQLEXPRESS;Initial Catalog=Employee;Integrated Security=True" com.CommandText = "select * from employee1" com.Connection = conn dap.SelectCommand = com dap.Fill(ds, 0) DataGridView1.DataSource = ds.Tables(0) End Sub

sathish

sathish

17y
4.1k
0
Reply

    i agree with the steve decosta answer

    DataGridView1.databind method is missing . it should come before end sub

    there is left the DataGridView1.databind() statements.