Dim ds1 As New DataSet() 'Dim ds As New DataSet() Dim sql1 As String = "SELECT sum(present) FROM attendance where present='1' and Emp_id='" & TextBox1.Text & "'" Dim connection As New SqlConnection(str) Dim dataadapter1 As New SqlDataAdapter(sql1, str) connection.Open() dataadapter1.Fill(ds1, "attendance") 'ds.Tables(0).Rows(0)(0) = ds1.Tables(0).Rows(0)(0) DataGridView2.DataSource = ds1.Tables(0).Rows(0)(0) connection.Close() 'DataGridView2.DataSource = ds1.Tables(0).Rows(0)(0) 'DataGridView2.DataMember = "attendance"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)