Filling a Dataset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sid Price

    #1

    Filling a Dataset

    I have Dataset that I need to filter into another Dataset for display and I
    can not find out how to do this. I have found methods for copying a Dataset
    but I can not see how to filter the rows copied using my query.

    I hoped to be able to use a DataAdaptor to do this but SelectCommand
    requires a connection and I don't see how to create a connection to my
    Dataset object.

    Any pointers would be much appreciated.
    Sid.

    (VB.NET 2003)


  • RobinS

    #2
    Re: Filling a Dataset

    You can use a dataview of the table for display.

    dv = New DataView()
    dv.Table = ds.Tables("Cust omers")
    dv.RowFilter = "Country = 'USA'"

    Then use the dataview to display.

    You can also copy the dataview to a new table using dv.ToTable.

    Robin S.
    Ts'i mahnu uterna ot twan ot geifur hingts uto.
    -----------------------------------------------
    "Sid Price" <sid@nowhere.co mwrote in message
    news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
    >I have Dataset that I need to filter into another Dataset for display and
    >I can not find out how to do this. I have found methods for copying a
    >Dataset but I can not see how to filter the rows copied using my query.
    >
    I hoped to be able to use a DataAdaptor to do this but SelectCommand
    requires a connection and I don't see how to create a connection to my
    Dataset object.
    >
    Any pointers would be much appreciated.
    Sid.
    >
    (VB.NET 2003)
    >
    >

    Comment

    • Sid Price

      #3
      Re: Filling a Dataset

      Robin,

      DataView.ToTabl e is not a defined method ... I am using VB.NET 2003.

      I don't see any way to get the filtered data from the DataView into my new
      Dataset.

      Sid.


      "RobinS" <RobinS@NoSpam. yah.nonewrote in message
      news:Wqadnfy5fO GNF0HYnZ2dnUVZ_ qqrnZ2d@comcast .com...
      You can use a dataview of the table for display.
      >
      dv = New DataView()
      dv.Table = ds.Tables("Cust omers")
      dv.RowFilter = "Country = 'USA'"
      >
      Then use the dataview to display.
      >
      You can also copy the dataview to a new table using dv.ToTable.
      >
      Robin S.
      Ts'i mahnu uterna ot twan ot geifur hingts uto.
      -----------------------------------------------
      "Sid Price" <sid@nowhere.co mwrote in message
      news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
      >>I have Dataset that I need to filter into another Dataset for display and
      >>I can not find out how to do this. I have found methods for copying a
      >>Dataset but I can not see how to filter the rows copied using my query.
      >>
      >I hoped to be able to use a DataAdaptor to do this but SelectCommand
      >requires a connection and I don't see how to create a connection to my
      >Dataset object.
      >>
      >Any pointers would be much appreciated.
      >Sid.
      >>
      >(VB.NET 2003)
      >>
      >>
      >
      >

      Comment

      • =?Utf-8?B?S2VycnkgTW9vcm1hbg==?=

        #4
        Re: Filling a Dataset

        Sid,

        Why do you need to get the data into a new dataset/datatable?

        Just use the filtered dataview for display, that's what it is for.

        The "ToTable" method is new in .Net 2.0, but you should not need it for
        display purposes.

        Kerry Moorman


        "Sid Price" wrote:
        Robin,
        >
        DataView.ToTabl e is not a defined method ... I am using VB.NET 2003.
        >
        I don't see any way to get the filtered data from the DataView into my new
        Dataset.
        >
        Sid.
        >
        >
        "RobinS" <RobinS@NoSpam. yah.nonewrote in message
        news:Wqadnfy5fO GNF0HYnZ2dnUVZ_ qqrnZ2d@comcast .com...
        You can use a dataview of the table for display.

        dv = New DataView()
        dv.Table = ds.Tables("Cust omers")
        dv.RowFilter = "Country = 'USA'"

        Then use the dataview to display.

        You can also copy the dataview to a new table using dv.ToTable.

        Robin S.
        Ts'i mahnu uterna ot twan ot geifur hingts uto.
        -----------------------------------------------
        "Sid Price" <sid@nowhere.co mwrote in message
        news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
        >I have Dataset that I need to filter into another Dataset for display and
        >I can not find out how to do this. I have found methods for copying a
        >Dataset but I can not see how to filter the rows copied using my query.
        >
        I hoped to be able to use a DataAdaptor to do this but SelectCommand
        requires a connection and I don't see how to create a connection to my
        Dataset object.
        >
        Any pointers would be much appreciated.
        Sid.
        >
        (VB.NET 2003)
        >
        >
        >
        >
        >

        Comment

        • Sid Price

          #5
          Re: Filling a Dataset

          Kerry,

          The application does its data processing using a Dataset in many areas. This
          particular Dataset is built from an imported CSV rather than a database,
          which is where many other Datasets come from. We do not want to duplicate
          the functionality of our application to process this imported data, we want
          to use the code that already exists, i.e. the code that expects data input
          from a Dataset. It is not simply a matter of display.

          Sid.

          "Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.comwrote in message
          news:681C3514-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
          Sid,
          >
          Why do you need to get the data into a new dataset/datatable?
          >
          Just use the filtered dataview for display, that's what it is for.
          >
          The "ToTable" method is new in .Net 2.0, but you should not need it for
          display purposes.
          >
          Kerry Moorman
          >
          >
          "Sid Price" wrote:
          >
          >Robin,
          >>
          >DataView.ToTab le is not a defined method ... I am using VB.NET 2003.
          >>
          >I don't see any way to get the filtered data from the DataView into my
          >new
          >Dataset.
          >>
          >Sid.
          >>
          >>
          >"RobinS" <RobinS@NoSpam. yah.nonewrote in message
          >news:Wqadnfy5f OGNF0HYnZ2dnUVZ _qqrnZ2d@comcas t.com...
          You can use a dataview of the table for display.
          >
          dv = New DataView()
          dv.Table = ds.Tables("Cust omers")
          dv.RowFilter = "Country = 'USA'"
          >
          Then use the dataview to display.
          >
          You can also copy the dataview to a new table using dv.ToTable.
          >
          Robin S.
          Ts'i mahnu uterna ot twan ot geifur hingts uto.
          -----------------------------------------------
          "Sid Price" <sid@nowhere.co mwrote in message
          news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
          >>I have Dataset that I need to filter into another Dataset for display
          >>and
          >>I can not find out how to do this. I have found methods for copying a
          >>Dataset but I can not see how to filter the rows copied using my query.
          >>
          >I hoped to be able to use a DataAdaptor to do this but SelectCommand
          >requires a connection and I don't see how to create a connection to my
          >Dataset object.
          >>
          >Any pointers would be much appreciated.
          >Sid.
          >>
          >(VB.NET 2003)
          >>
          >>
          >
          >
          >>
          >>
          >>

          Comment

          • PFC Sadr

            #6
            Re: Filling a Dataset

            CSV + 'BULK INSERT' = SQL Server

            lose the training wheels; it doesn't make sense to reinvent the wheel




            On Feb 21, 11:37 am, "Sid Price" <s...@nowhere.c omwrote:
            Kerry,
            >
            The application does its data processing using a Dataset in many areas. This
            particular Dataset is built from an imported CSV rather than a database,
            which is where many other Datasets come from. We do not want to duplicate
            the functionality of our application to process this imported data, we want
            to use the code that already exists, i.e. the code that expects data input
            from a Dataset. It is not simply a matter of display.
            >
            Sid.
            >
            "Kerry Moorman" <KerryMoor...@d iscussions.micr osoft.comwrote in message
            >
            news:681C3514-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
            >
            >
            >
            Sid,
            >
            Why do you need to get the data into a new dataset/datatable?
            >
            Just use the filtered dataview for display, that's what it is for.
            >
            The "ToTable" method is new in .Net 2.0, but you should not need it for
            display purposes.
            >
            Kerry Moorman
            >
            "Sid Price" wrote:
            >
            Robin,
            >
            DataView.ToTabl e is not a defined method ... I am using VB.NET 2003.
            >
            I don't see any way to get the filtered data from the DataView into my
            new
            Dataset.
            >
            Sid.
            >
            "RobinS" <Rob...@NoSpam. yah.nonewrote in message
            >news:Wqadnfy5f OGNF0HYnZ2dnUVZ _qqrnZ2d@comcas t.com...
            You can use a dataview of the table for display.
            >
            dv = New DataView()
            dv.Table = ds.Tables("Cust omers")
            dv.RowFilter = "Country = 'USA'"
            >
            Then use the dataview to display.
            >
            You can also copy the dataview to a new table using dv.ToTable.
            >
            Robin S.
            Ts'i mahnu uterna ot twan ot geifur hingts uto.
            -----------------------------------------------
            "Sid Price" <s...@nowhere.c omwrote in message
            news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
            >I have Dataset that I need to filter into another Dataset for display
            >and
            >I can not find out how to do this. I have found methods for copying a
            >Dataset but I can not see how to filter the rows copied using my query.
            >
            I hoped to be able to use a DataAdaptor to do this but SelectCommand
            requires a connection and I don't see how to create a connection to my
            Dataset object.
            >
            Any pointers would be much appreciated.
            Sid.
            >
            (VB.NET 2003)- Hide quoted text -
            >
            - Show quoted text -

            Comment

            • Sid Price

              #7
              Re: Filling a Dataset

              Well that is truly an very informative message ... NOT.

              Perhaps you could explain how changing the source of the data would would
              help us achieve our goal when it is clear our problem is associated with
              DataAdapter and DataSet objects. Maybe you really are a smart as you think
              you are and have the answer!

              Sid.

              "PFC Sadr" <pfc_sadr@hotma il.comwrote in message
              news:1172125397 .301763.44870@l 53g2000cwa.goog legroups.com...
              CSV + 'BULK INSERT' = SQL Server
              >
              lose the training wheels; it doesn't make sense to reinvent the wheel
              >
              >
              >
              >
              On Feb 21, 11:37 am, "Sid Price" <s...@nowhere.c omwrote:
              >Kerry,
              >>
              >The application does its data processing using a Dataset in many areas.
              >This
              >particular Dataset is built from an imported CSV rather than a database,
              >which is where many other Datasets come from. We do not want to duplicate
              >the functionality of our application to process this imported data, we
              >want
              >to use the code that already exists, i.e. the code that expects data
              >input
              >from a Dataset. It is not simply a matter of display.
              >>
              >Sid.
              >>
              >"Kerry Moorman" <KerryMoor...@d iscussions.micr osoft.comwrote in message
              >>
              >news:681C351 4-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
              >>
              >>
              >>
              Sid,
              >>
              Why do you need to get the data into a new dataset/datatable?
              >>
              Just use the filtered dataview for display, that's what it is for.
              >>
              The "ToTable" method is new in .Net 2.0, but you should not need it for
              display purposes.
              >>
              Kerry Moorman
              >>
              "Sid Price" wrote:
              >>
              >Robin,
              >>
              >DataView.ToTab le is not a defined method ... I am using VB.NET 2003.
              >>
              >I don't see any way to get the filtered data from the DataView into my
              >new
              >Dataset.
              >>
              >Sid.
              >>
              >"RobinS" <Rob...@NoSpam. yah.nonewrote in message
              >>news:Wqadnfy5 fOGNF0HYnZ2dnUV Z_qqrnZ2d@comca st.com...
              You can use a dataview of the table for display.
              >>
              dv = New DataView()
              dv.Table = ds.Tables("Cust omers")
              dv.RowFilter = "Country = 'USA'"
              >>
              Then use the dataview to display.
              >>
              You can also copy the dataview to a new table using dv.ToTable.
              >>
              Robin S.
              Ts'i mahnu uterna ot twan ot geifur hingts uto.
              -----------------------------------------------
              "Sid Price" <s...@nowhere.c omwrote in message
              >news:uQJXi7dVH HA.1200@TK2MSFT NGP04.phx.gbl.. .
              >>I have Dataset that I need to filter into another Dataset for
              >>display
              >>and
              >>I can not find out how to do this. I have found methods for copying
              >>a
              >>Dataset but I can not see how to filter the rows copied using my
              >>query.
              >>
              >I hoped to be able to use a DataAdaptor to do this but
              >SelectComman d
              >requires a connection and I don't see how to create a connection to
              >my
              >Dataset object.
              >>
              >Any pointers would be much appreciated.
              >Sid.
              >>
              >(VB.NET 2003)- Hide quoted text -
              >>
              >- Show quoted text -
              >
              >

              Comment

              • PFC Sadr

                #8
                Re: Filling a Dataset

                import it into a database and learn how to use a fucking where clause.

                Datasets are for goddamn retards, if datareaders are faster and you're
                not using them then you're not putting your customers first





                On Feb 22, 6:31 am, "Sid Price" <s...@nowhere.c omwrote:
                Well that is truly an very informative message ... NOT.
                >
                Perhaps you could explain how changing the source of the data would would
                help us achieve our goal when it is clear our problem is associated with
                DataAdapter and DataSet objects. Maybe you really are a smart as you think
                you are and have the answer!
                >
                Sid.
                >
                "PFC Sadr" <pfc_s...@hotma il.comwrote in message
                >
                news:1172125397 .301763.44870@l 53g2000cwa.goog legroups.com...
                >
                >
                >
                CSV + 'BULK INSERT' = SQL Server
                >
                lose the training wheels; it doesn't make sense to reinvent the wheel
                >
                On Feb 21, 11:37 am, "Sid Price" <s...@nowhere.c omwrote:
                Kerry,
                >
                The application does its data processing using a Dataset in many areas.
                This
                particular Dataset is built from an imported CSV rather than a database,
                which is where many other Datasets come from. We do not want to duplicate
                the functionality of our application to process this imported data, we
                want
                to use the code that already exists, i.e. the code that expects data
                input
                from a Dataset. It is not simply a matter of display.
                >
                Sid.
                >
                "Kerry Moorman" <KerryMoor...@d iscussions.micr osoft.comwrote in message
                >
                >news:681C351 4-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
                >
                Sid,
                >
                Why do you need to get the data into a new dataset/datatable?
                >
                Just use the filtered dataview for display, that's what it is for.
                >
                The "ToTable" method is new in .Net 2.0, but you should not need it for
                display purposes.
                >
                Kerry Moorman
                >
                "Sid Price" wrote:
                >
                Robin,
                >
                DataView.ToTabl e is not a defined method ... I am using VB.NET 2003.
                >
                I don't see any way to get the filtered data from the DataView into my
                new
                Dataset.
                >
                Sid.
                >
                "RobinS" <Rob...@NoSpam. yah.nonewrote in message
                >news:Wqadnfy5f OGNF0HYnZ2dnUVZ _qqrnZ2d@comcas t.com...
                You can use a dataview of the table for display.
                >
                dv = New DataView()
                dv.Table = ds.Tables("Cust omers")
                dv.RowFilter = "Country = 'USA'"
                >
                Then use the dataview to display.
                >
                You can also copy the dataview to a new table using dv.ToTable.
                >
                Robin S.
                Ts'i mahnu uterna ot twan ot geifur hingts uto.
                -----------------------------------------------
                "Sid Price" <s...@nowhere.c omwrote in message
                news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
                >I have Dataset that I need to filter into another Dataset for
                >display
                >and
                >I can not find out how to do this. I have found methods for copying
                >a
                >Dataset but I can not see how to filter the rows copied using my
                >query.
                >
                I hoped to be able to use a DataAdaptor to do this but
                SelectCommand
                requires a connection and I don't see how to create a connection to
                my
                Dataset object.
                >
                Any pointers would be much appreciated.
                Sid.
                >
                (VB.NET 2003)- Hide quoted text -
                >
                - Show quoted text -- Hide quoted text -
                >
                - Show quoted text -

                Comment

                • RobinS

                  #9
                  Re: Filling a Dataset

                  Well, can you filter it and then move the rows from one dataset to the
                  other one one-by-one? That's about all I can think of, the "brute force"
                  method.

                  Robin S.
                  ----------------------------------------
                  "Sid Price" <sid@nowhere.co mwrote in message
                  news:uFwmu%23eV HHA.4832@TK2MSF TNGP04.phx.gbl. ..
                  Kerry,
                  >
                  The application does its data processing using a Dataset in many areas.
                  This particular Dataset is built from an imported CSV rather than a
                  database, which is where many other Datasets come from. We do not want to
                  duplicate the functionality of our application to process this imported
                  data, we want to use the code that already exists, i.e. the code that
                  expects data input from a Dataset. It is not simply a matter of display.
                  >
                  Sid.
                  >
                  "Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.comwrote in message
                  news:681C3514-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
                  >Sid,
                  >>
                  >Why do you need to get the data into a new dataset/datatable?
                  >>
                  >Just use the filtered dataview for display, that's what it is for.
                  >>
                  >The "ToTable" method is new in .Net 2.0, but you should not need it for
                  >display purposes.
                  >>
                  >Kerry Moorman
                  >>
                  >>
                  >"Sid Price" wrote:
                  >>
                  >>Robin,
                  >>>
                  >>DataView.ToTa ble is not a defined method ... I am using VB.NET 2003.
                  >>>
                  >>I don't see any way to get the filtered data from the DataView into my
                  >>new
                  >>Dataset.
                  >>>
                  >>Sid.
                  >>>
                  >>>
                  >>"RobinS" <RobinS@NoSpam. yah.nonewrote in message
                  >>news:Wqadnfy5 fOGNF0HYnZ2dnUV Z_qqrnZ2d@comca st.com...
                  >You can use a dataview of the table for display.
                  >>
                  > dv = New DataView()
                  > dv.Table = ds.Tables("Cust omers")
                  > dv.RowFilter = "Country = 'USA'"
                  >>
                  >Then use the dataview to display.
                  >>
                  >You can also copy the dataview to a new table using dv.ToTable.
                  >>
                  >Robin S.
                  >Ts'i mahnu uterna ot twan ot geifur hingts uto.
                  >-----------------------------------------------
                  >"Sid Price" <sid@nowhere.co mwrote in message
                  >news:uQJXi7dVH HA.1200@TK2MSFT NGP04.phx.gbl.. .
                  >>>I have Dataset that I need to filter into another Dataset for display
                  >>>and
                  >>>I can not find out how to do this. I have found methods for copying a
                  >>>Dataset but I can not see how to filter the rows copied using my
                  >>>query.
                  >>>
                  >>I hoped to be able to use a DataAdaptor to do this but SelectCommand
                  >>requires a connection and I don't see how to create a connection to
                  >>my
                  >>Dataset object.
                  >>>
                  >>Any pointers would be much appreciated.
                  >>Sid.
                  >>>
                  >>(VB.NET 2003)
                  >>>
                  >>>
                  >>
                  >>
                  >>>
                  >>>
                  >>>
                  >
                  >

                  Comment

                  • =?Utf-8?B?S2VycnkgTW9vcm1hbg==?=

                    #10
                    Re: Filling a Dataset

                    Sid,

                    I just saw this post on another news group and thought it might apply to
                    what you are trying to do:



                    Kerry Moorman


                    "Sid Price" wrote:
                    Kerry,
                    >
                    The application does its data processing using a Dataset in many areas. This
                    particular Dataset is built from an imported CSV rather than a database,
                    which is where many other Datasets come from. We do not want to duplicate
                    the functionality of our application to process this imported data, we want
                    to use the code that already exists, i.e. the code that expects data input
                    from a Dataset. It is not simply a matter of display.
                    >
                    Sid.
                    >
                    "Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.comwrote in message
                    news:681C3514-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
                    Sid,

                    Why do you need to get the data into a new dataset/datatable?

                    Just use the filtered dataview for display, that's what it is for.

                    The "ToTable" method is new in .Net 2.0, but you should not need it for
                    display purposes.

                    Kerry Moorman


                    "Sid Price" wrote:
                    Robin,
                    >
                    DataView.ToTabl e is not a defined method ... I am using VB.NET 2003.
                    >
                    I don't see any way to get the filtered data from the DataView into my
                    new
                    Dataset.
                    >
                    Sid.
                    >
                    >
                    "RobinS" <RobinS@NoSpam. yah.nonewrote in message
                    news:Wqadnfy5fO GNF0HYnZ2dnUVZ_ qqrnZ2d@comcast .com...
                    You can use a dataview of the table for display.

                    dv = New DataView()
                    dv.Table = ds.Tables("Cust omers")
                    dv.RowFilter = "Country = 'USA'"

                    Then use the dataview to display.

                    You can also copy the dataview to a new table using dv.ToTable.

                    Robin S.
                    Ts'i mahnu uterna ot twan ot geifur hingts uto.
                    -----------------------------------------------
                    "Sid Price" <sid@nowhere.co mwrote in message
                    news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
                    >I have Dataset that I need to filter into another Dataset for display
                    >and
                    >I can not find out how to do this. I have found methods for copying a
                    >Dataset but I can not see how to filter the rows copied using my query.
                    >
                    I hoped to be able to use a DataAdaptor to do this but SelectCommand
                    requires a connection and I don't see how to create a connection to my
                    Dataset object.
                    >
                    Any pointers would be much appreciated.
                    Sid.
                    >
                    (VB.NET 2003)
                    >
                    >


                    >
                    >
                    >
                    >
                    >
                    >

                    Comment

                    • Sid Price

                      #11
                      Re: Filling a Dataset

                      This looks promising, thanks Kerry. I will be looking at this approach
                      later,
                      Sid.


                      "Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.comwrote in message
                      news:052ACCA3-E03B-4FBA-AAA7-77CB7D6F43DD@mi crosoft.com...
                      Sid,
                      >
                      I just saw this post on another news group and thought it might apply to
                      what you are trying to do:
                      >

                      >
                      Kerry Moorman
                      >
                      >
                      "Sid Price" wrote:
                      >
                      >Kerry,
                      >>
                      >The application does its data processing using a Dataset in many areas.
                      >This
                      >particular Dataset is built from an imported CSV rather than a database,
                      >which is where many other Datasets come from. We do not want to duplicate
                      >the functionality of our application to process this imported data, we
                      >want
                      >to use the code that already exists, i.e. the code that expects data
                      >input
                      >from a Dataset. It is not simply a matter of display.
                      >>
                      >Sid.
                      >>
                      >"Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.comwrote in message
                      >news:681C351 4-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
                      Sid,
                      >
                      Why do you need to get the data into a new dataset/datatable?
                      >
                      Just use the filtered dataview for display, that's what it is for.
                      >
                      The "ToTable" method is new in .Net 2.0, but you should not need it for
                      display purposes.
                      >
                      Kerry Moorman
                      >
                      >
                      "Sid Price" wrote:
                      >
                      >Robin,
                      >>
                      >DataView.ToTab le is not a defined method ... I am using VB.NET 2003.
                      >>
                      >I don't see any way to get the filtered data from the DataView into my
                      >new
                      >Dataset.
                      >>
                      >Sid.
                      >>
                      >>
                      >"RobinS" <RobinS@NoSpam. yah.nonewrote in message
                      >news:Wqadnfy5f OGNF0HYnZ2dnUVZ _qqrnZ2d@comcas t.com...
                      You can use a dataview of the table for display.
                      >
                      dv = New DataView()
                      dv.Table = ds.Tables("Cust omers")
                      dv.RowFilter = "Country = 'USA'"
                      >
                      Then use the dataview to display.
                      >
                      You can also copy the dataview to a new table using dv.ToTable.
                      >
                      Robin S.
                      Ts'i mahnu uterna ot twan ot geifur hingts uto.
                      -----------------------------------------------
                      "Sid Price" <sid@nowhere.co mwrote in message
                      news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
                      >>I have Dataset that I need to filter into another Dataset for
                      >>display
                      >>and
                      >>I can not find out how to do this. I have found methods for copying
                      >>a
                      >>Dataset but I can not see how to filter the rows copied using my
                      >>query.
                      >>
                      >I hoped to be able to use a DataAdaptor to do this but
                      >SelectComman d
                      >requires a connection and I don't see how to create a connection to
                      >my
                      >Dataset object.
                      >>
                      >Any pointers would be much appreciated.
                      >Sid.
                      >>
                      >(VB.NET 2003)
                      >>
                      >>
                      >
                      >
                      >>
                      >>
                      >>
                      >>
                      >>
                      >>

                      Comment

                      • Sid Price

                        #12
                        Re: Filling a Dataset

                        Kerry,

                        Thank you so much for the link, it pointed me in the correct direction to a
                        resolution of my issue.

                        Sid.

                        "Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.comwrote in message
                        news:052ACCA3-E03B-4FBA-AAA7-77CB7D6F43DD@mi crosoft.com...
                        Sid,
                        >
                        I just saw this post on another news group and thought it might apply to
                        what you are trying to do:
                        >

                        >
                        Kerry Moorman
                        >
                        >
                        "Sid Price" wrote:
                        >
                        >Kerry,
                        >>
                        >The application does its data processing using a Dataset in many areas.
                        >This
                        >particular Dataset is built from an imported CSV rather than a database,
                        >which is where many other Datasets come from. We do not want to duplicate
                        >the functionality of our application to process this imported data, we
                        >want
                        >to use the code that already exists, i.e. the code that expects data
                        >input
                        >from a Dataset. It is not simply a matter of display.
                        >>
                        >Sid.
                        >>
                        >"Kerry Moorman" <KerryMoorman@d iscussions.micr osoft.comwrote in message
                        >news:681C351 4-9731-4404-9F2A-4816F114F1D4@mi crosoft.com...
                        Sid,
                        >
                        Why do you need to get the data into a new dataset/datatable?
                        >
                        Just use the filtered dataview for display, that's what it is for.
                        >
                        The "ToTable" method is new in .Net 2.0, but you should not need it for
                        display purposes.
                        >
                        Kerry Moorman
                        >
                        >
                        "Sid Price" wrote:
                        >
                        >Robin,
                        >>
                        >DataView.ToTab le is not a defined method ... I am using VB.NET 2003.
                        >>
                        >I don't see any way to get the filtered data from the DataView into my
                        >new
                        >Dataset.
                        >>
                        >Sid.
                        >>
                        >>
                        >"RobinS" <RobinS@NoSpam. yah.nonewrote in message
                        >news:Wqadnfy5f OGNF0HYnZ2dnUVZ _qqrnZ2d@comcas t.com...
                        You can use a dataview of the table for display.
                        >
                        dv = New DataView()
                        dv.Table = ds.Tables("Cust omers")
                        dv.RowFilter = "Country = 'USA'"
                        >
                        Then use the dataview to display.
                        >
                        You can also copy the dataview to a new table using dv.ToTable.
                        >
                        Robin S.
                        Ts'i mahnu uterna ot twan ot geifur hingts uto.
                        -----------------------------------------------
                        "Sid Price" <sid@nowhere.co mwrote in message
                        news:uQJXi7dVHH A.1200@TK2MSFTN GP04.phx.gbl...
                        >>I have Dataset that I need to filter into another Dataset for
                        >>display
                        >>and
                        >>I can not find out how to do this. I have found methods for copying
                        >>a
                        >>Dataset but I can not see how to filter the rows copied using my
                        >>query.
                        >>
                        >I hoped to be able to use a DataAdaptor to do this but
                        >SelectComman d
                        >requires a connection and I don't see how to create a connection to
                        >my
                        >Dataset object.
                        >>
                        >Any pointers would be much appreciated.
                        >Sid.
                        >>
                        >(VB.NET 2003)
                        >>
                        >>
                        >
                        >
                        >>
                        >>
                        >>
                        >>
                        >>
                        >>

                        Comment

                        Working...