G
Guest
Hello,
I created a dataset and dataTable in the designer (VB2005) as the datasource
for a Reportviewer control. Up to now I have been creating
dataTables/datasets/dataAdapters on the fly at runtime. But I need to set
field properties on the reportviewer at design time - could probably do it at
run time - but too much code.
So at run time I do this to fill a datatable on the fly
dim da As new sqldataAdapter
dim ds as new dataset
da.selectcommand = new sqlcommand
da.selectcommand.connection = conn
da.selectcommand.commantext = "select * from tbl1")
da.Fill(ds, "tblx")
Now my dataset exists at design time along with the datatable. How do I
fill the existing datatable? the runtime code above complains if I reference
the dataset/dataTable I created at design time. Any suggestions appreciated.
Thanks,
Rich
I created a dataset and dataTable in the designer (VB2005) as the datasource
for a Reportviewer control. Up to now I have been creating
dataTables/datasets/dataAdapters on the fly at runtime. But I need to set
field properties on the reportviewer at design time - could probably do it at
run time - but too much code.
So at run time I do this to fill a datatable on the fly
dim da As new sqldataAdapter
dim ds as new dataset
da.selectcommand = new sqlcommand
da.selectcommand.connection = conn
da.selectcommand.commantext = "select * from tbl1")
da.Fill(ds, "tblx")
Now my dataset exists at design time along with the datatable. How do I
fill the existing datatable? the runtime code above complains if I reference
the dataset/dataTable I created at design time. Any suggestions appreciated.
Thanks,
Rich