DataSet Question

Pol012

New Member
I'm new to datasets in .NET....I have a question. If I want to define more than one dataset in a component file....how do I do it in the code behind of the component1.vb file? <BR>Currently...I have:<BR><BR> Public Sub FillDataSet(ByVal dSet As RsMember)<BR> OleDbDataAdapter1.Fill(dSet)<BR> <BR>How can I get this to read BOTH datasets? Do I need a separate component file for EACH datagrid??????<BR>Just declare another dataset...<BR><BR>public ds2 as dataset or...<BR>private ds2 as dataset<BR><BR>in the codebehind file. Declare as many as you want...<BR><BR>but I dont see the point of doing that. Datasets are designed to hold multiple sets of data. I see you have a FillDataSet method. This is the right idea. Make one dataset and all tables you need call your components appropriate fill method. <BR><BR>Example.<BR><BR>dim ds as new Dataset()<BR><BR>DbComponent.FillTable1(ds)<BR>DbComponent.FillTable2(ds) <BR><BR>the dataset now contains both table1 and table2 or whatever you named it when calling the DataAdapter.Fill method. No need to create seperate datasets.
 
Back
Top