Databind () on gridview not working VB.net ASP.Net
I have a datatable with 10 checked rows named dtable. I am trying to bind it to a gridview and nothing appears on my asp.net page. Why aren't these relatively simple few lines populating my gridview?
Dim con As SqlConnection = Nothing
Dim dTable As DataTable
Dim dataAdapter As SqlDataAdapter
Dim sqlcmd As String
.......
dTable = New DataTable
dataAdapter = New SqlDataAdapter(sqlcmd, con)
dataAdapter.Fill(dTable)
'DATATABLE at this point has 10 rows in it, I verified that at runtime
gvUnitSystem.DataSource = dTable
gvUnitSystem.DataBind()
End Sub
What am I doing wrong?
0
kevin bailey
source
to share