P
Patrick Sullivan
Hi all, I odered a book on VB.Net (ADO Net core reference) but haven't
recieved it yet. And I have found lots of info on datagrids and have used
them lots before. But now using a typed dataset, I cannot get a view table
in the typed dataset to load into the grid. No errors, just no records.
"Applications" is the typed dataset, and it contains one view named
"vwApplications" that works in SQL server, and I can get it to work using
regular untyped datasets in ADO.Net. What do I need to do in typed datasets
to use it? BTW, it just displays a row of nulls, and it should have data.
There's no null data in the tables or view.
' create instance of the typed dataset
tds = New Applications
' command object to pull data for datasets
Dim cmd As New SqlCommand("SELECT * FROM vwApplications", con)
' Use the sqldataadapter to fill datasets
Dim da As SqlDataAdapter = New SqlDataAdapter
' Select command for Typed Dataset
da.SelectCommand = cmd
' Fill Dataset
da.Fill(tds)
dgApps.SetDataBinding(tds, "vwApplications")
con.Close()
-- TIA
Patrick Sullivan, AA-BA, BA-IT
recieved it yet. And I have found lots of info on datagrids and have used
them lots before. But now using a typed dataset, I cannot get a view table
in the typed dataset to load into the grid. No errors, just no records.
"Applications" is the typed dataset, and it contains one view named
"vwApplications" that works in SQL server, and I can get it to work using
regular untyped datasets in ADO.Net. What do I need to do in typed datasets
to use it? BTW, it just displays a row of nulls, and it should have data.
There's no null data in the tables or view.
' create instance of the typed dataset
tds = New Applications
' command object to pull data for datasets
Dim cmd As New SqlCommand("SELECT * FROM vwApplications", con)
' Use the sqldataadapter to fill datasets
Dim da As SqlDataAdapter = New SqlDataAdapter
' Select command for Typed Dataset
da.SelectCommand = cmd
' Fill Dataset
da.Fill(tds)
dgApps.SetDataBinding(tds, "vwApplications")
con.Close()
-- TIA
Patrick Sullivan, AA-BA, BA-IT