The below code was written to bind the datatable to the grid, but i am unable to fill the grid.... I am unable to fill the datagrid, I'll be very thankfull for your help.
Private Sub BindGrid()
Dim CMD As New SqlCommand
Dim ad As New SqlDataAdapter(CMD)
Dim DT As DataTable
CMD.Connection = constring
CMD.CommandText = "Exec SP_View_Emp_details ' " & txtPayrollPeriod.Text & "'"
DT = CMD.ExecuteScalar
constring.Open()
ad.Fill(DT)
DataGridView1.DataSource = DT
CMD.ExecuteNonQuery()
'DataGridView1.DataBind()
constring.Close()
End Sub