DataSet Question

Results 1 to 2 of 2

Thread: DataSet Question

  1. #1
    Join Date
    Dec 1969

    Default DataSet Question

    I&#039;m new to datasets in .NET....I have a question. If I want to define more than one dataset in a component 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>

  2. #2
    Join Date
    Dec 1969

    Default RE: DataSet Question

    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>DbC omponent.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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts