Dim ds1 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)
DataGridView2.DataSource = ds1.Tables(0).Rows(0)(0)
i wrote the above code to bind a value in a specific column in a datagrid.but it's not working..please tell me the problem..
and i wrote one same function with 3 values which i am binding in the same datagrid.
Just use databinding to retireve data from database
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)