What's Better? Adding Incomplete DataRows or Leaving Detached

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jehugaleahsa@gmail.com

    What's Better? Adding Incomplete DataRows or Leaving Detached

    Hello:

    We wrote an entire application where we add our DataRows to our
    DataTables immediately. However, we have to shut off our constraints
    to do this. We would like to use detached DataRows to circumvent this.

    What do you normally do to track detached DataRows? Is there a way to
    retrieve them? or do I have to stored them in some temporary location?

    Thanks for any input!
    ~Travis
  • JDeats

    #2
    Re: What's Better? Adding Incomplete DataRows or Leaving Detached

    On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
    wrote:
    Hello:
    >
    We wrote an entire application where we add our DataRows to our
    DataTables immediately. However, we have to shut off our constraints
    to do this. We would like to use detached DataRows to circumvent this.
    >
    What do you normally do to track detached DataRows? Is there a way to
    retrieve them? or do I have to stored them in some temporary location?
    >
    Thanks for any input!
    ~Travis
    Let me make sure I understand: So you're using "detached" DataRows
    stored in a collection of some sort outside your DataTable because if
    you added them to your DataTable it would violate an existing
    constraint and you want to know what the best way is to track deteched
    DataRows in general. There's just not enough context to the question
    to give a very useful answer, but I would imagine the worst solution
    would be circumventing the restraints on your DataTable.

    Can you provide more detail?


    Comment

    • jehugaleahsa@gmail.com

      #3
      Re: What's Better? Adding Incomplete DataRows or Leaving Detached

      On Aug 25, 2:40 pm, JDeats <Jeremy.De...@g mail.comwrote:
      On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
      wrote:
      >
      Hello:
      >
      We wrote an entire application where we add our DataRows to our
      DataTables immediately. However, we have to shut off our constraints
      to do this. We would like to use detached DataRows to circumvent this.
      >
      What do you normally do to track detached DataRows? Is there a way to
      retrieve them? or do I have to stored them in some temporary location?
      >
      Thanks for any input!
      ~Travis
      >
      Let me make sure I understand: So you're using "detached" DataRows
      stored in a collection of some sort outside your DataTable because if
      you added them to your DataTable it would violate an existing
      constraint and you want to know what the best way is to track deteched
      DataRows in general. There's just not enough context to the question
      to give a very useful answer, but I would imagine the worst solution
      would be circumventing the restraints on your DataTable.
      >
      Can you provide more detail?
      Well, no, I can't. My question is very open. I know people use
      DataTables to track changes on their UIs.

      I want to know how they track DataRows that haven't been added to the
      DataTable. If you don't store them somewhere, I don't know how to get
      them back. I am curious whether people store them in a List<DataRow>
      or if there is a more elegant solution.

      Plain curiousity on how to do it.

      Thanks,
      Travis

      Comment

      • rusty.lee.2008@gmail.com

        #4
        Re: What's Better? Adding Incomplete DataRows or Leaving Detached

        I have used DataRowVersion to find changes to rows in a DataTable.

        -rusty


        On Aug 25, 2:11 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
        wrote:
        On Aug 25, 2:40 pm, JDeats <Jeremy.De...@g mail.comwrote:
        >
        >
        >
        >
        >
        On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
        wrote:
        >
        Hello:
        >
        We wrote an entire application where we add our DataRows to our
        DataTables immediately. However, we have to shut off our constraints
        to do this. We would like to use detached DataRows to circumvent this..
        >
        What do you normally do to track detached DataRows? Is there a way to
        retrieve them? or do I have to stored them in some temporary location?
        >
        Thanks for any input!
        ~Travis
        >
        Let me make sure I understand: So you're using "detached" DataRows
        stored in a collection of some sort outside your DataTable because if
        you added them to your DataTable it would violate an existing
        constraint and you want to know what the best way is to track deteched
        DataRows in general. There's just not enough context to the question
        to give a very useful answer, but I would imagine the worst solution
        would be circumventing the restraints on your DataTable.
        >
        Can you provide more detail?
        >
        Well, no, I can't. My question is very open. I know people use
        DataTables to track changes on their UIs.
        >
        I want to know how they track DataRows that haven't been added to the
        DataTable. If you don't store them somewhere, I don't know how to get
        them back. I am curious whether people store them in a List<DataRow>
        or if there is a more elegant solution.
        >
        Plain curiousity on how to do it.
        >
        Thanks,
        Travis- Hide quoted text -
        >
        - Show quoted text -

        Comment

        • jehugaleahsa@gmail.com

          #5
          Re: What's Better? Adding Incomplete DataRows or Leaving Detached

          On Aug 25, 4:06 pm, rusty.lee.2...@ gmail.com wrote:
          I have used DataRowVersion to find changes to rows in a DataTable.
          >
          -rusty
          >
          On Aug 25, 2:11 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
          wrote:
          >
          >
          >
          On Aug 25, 2:40 pm, JDeats <Jeremy.De...@g mail.comwrote:
          >
          On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
          wrote:
          >
          Hello:
          >
          We wrote an entire application where we add our DataRows to our
          DataTables immediately. However, we have to shut off our constraints
          to do this. We would like to use detached DataRows to circumvent this.
          >
          What do you normally do to track detached DataRows? Is there a way to
          retrieve them? or do I have to stored them in some temporary location?
          >
          Thanks for any input!
          ~Travis
          >
          Let me make sure I understand: So you're using "detached" DataRows
          stored in a collection of some sort outside your DataTable because if
          you added them to your DataTable it would violate an existing
          constraint and you want to know what the best way is to track deteched
          DataRows in general. There's just not enough context to the question
          to give a very useful answer, but I would imagine the worst solution
          would be circumventing the restraints on your DataTable.
          >
          Can you provide more detail?
          >
          Well, no, I can't. My question is very open. I know people use
          DataTables to track changes on their UIs.
          >
          I want to know how they track DataRows that haven't been added to the
          DataTable. If you don't store them somewhere, I don't know how to get
          them back. I am curious whether people store them in a List<DataRow>
          or if there is a more elegant solution.
          >
          Plain curiousity on how to do it.
          >
          Thanks,
          Travis- Hide quoted text -
          >
          - Show quoted text -- Hide quoted text -
          >
          - Show quoted text -
          Awesome. That is what I wanted to know!

          Comment

          • jehugaleahsa@gmail.com

            #6
            Re: What's Better? Adding Incomplete DataRows or Leaving Detached

            On Aug 25, 4:06 pm, rusty.lee.2...@ gmail.com wrote:
            I have used DataRowVersion to find changes to rows in a DataTable.
            >
            -rusty
            >
            On Aug 25, 2:11 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
            wrote:
            >
            >
            >
            On Aug 25, 2:40 pm, JDeats <Jeremy.De...@g mail.comwrote:
            >
            On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
            wrote:
            >
            Hello:
            >
            We wrote an entire application where we add our DataRows to our
            DataTables immediately. However, we have to shut off our constraints
            to do this. We would like to use detached DataRows to circumvent this.
            >
            What do you normally do to track detached DataRows? Is there a way to
            retrieve them? or do I have to stored them in some temporary location?
            >
            Thanks for any input!
            ~Travis
            >
            Let me make sure I understand: So you're using "detached" DataRows
            stored in a collection of some sort outside your DataTable because if
            you added them to your DataTable it would violate an existing
            constraint and you want to know what the best way is to track deteched
            DataRows in general. There's just not enough context to the question
            to give a very useful answer, but I would imagine the worst solution
            would be circumventing the restraints on your DataTable.
            >
            Can you provide more detail?
            >
            Well, no, I can't. My question is very open. I know people use
            DataTables to track changes on their UIs.
            >
            I want to know how they track DataRows that haven't been added to the
            DataTable. If you don't store them somewhere, I don't know how to get
            them back. I am curious whether people store them in a List<DataRow>
            or if there is a more elegant solution.
            >
            Plain curiousity on how to do it.
            >
            Thanks,
            Travis- Hide quoted text -
            >
            - Show quoted text -- Hide quoted text -
            >
            - Show quoted text -
            How can I quickly iterate over detached rows and add them to my
            DataTable?

            Comment

            • rustylee

              #7
              Re: What's Better? Adding Incomplete DataRows or Leaving Detached

              On Aug 26, 8:01 am, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
              wrote:
              On Aug 25, 4:06 pm, rusty.lee.2...@ gmail.com wrote:
              >
              >
              >
              >
              >
              I have used DataRowVersion to find changes to rows in a DataTable.
              >
              -rusty
              >
              On Aug 25, 2:11 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
              wrote:
              >
              On Aug 25, 2:40 pm, JDeats <Jeremy.De...@g mail.comwrote:
              >
              On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
              wrote:
              >
              Hello:
              >
              We wrote an entire application where we add our DataRows to our
              DataTables immediately. However, we have to shut off our constraints
              to do this. We would like to use detached DataRows to circumvent this.
              >
              What do you normally do to track detached DataRows? Is there a way to
              retrieve them? or do I have to stored them in some temporary location?
              >
              Thanks for any input!
              ~Travis
              >
              Let me make sure I understand: So you're using "detached" DataRows
              stored in a collection of some sort outside your DataTable because if
              you added them to your DataTable it would violate an existing
              constraint and you want to know what the best way is to track deteched
              DataRows in general. There's just not enough context to the question
              to give a very useful answer, but I would imagine the worst solution
              would be circumventing the restraints on your DataTable.
              >
              Can you provide more detail?
              >
              Well, no, I can't. My question is very open. I know people use
              DataTables to track changes on their UIs.
              >
              I want to know how they track DataRows that haven't been added to the
              DataTable. If you don't store them somewhere, I don't know how to get
              them back. I am curious whether people store them in a List<DataRow>
              or if there is a more elegant solution.
              >
              Plain curiousity on how to do it.
              >
              Thanks,
              Travis- Hide quoted text -
              >
              - Show quoted text -- Hide quoted text -
              >
              - Show quoted text -
              >
              How can I quickly iterate over detached rows and add them to my
              DataTable?- Hide quoted text -
              >
              - Show quoted text -
              I'm not sure I understand the question, but in general you add a
              DataRow to a DataTable with DataTable.Rows. Add(DataRow) method. This
              implies that the row can be added to the table. Basically the row you
              are adding has to have identical columns as the DataTable, I think.

              You would have to describe what it is you want to iterate through.
              Are these datarows part of a collection or array?

              -rusty

              Comment

              • jehugaleahsa@gmail.com

                #8
                Re: What's Better? Adding Incomplete DataRows or Leaving Detached

                On Aug 26, 4:32 pm, rustylee <rusty.lee.2... @gmail.comwrote :
                On Aug 26, 8:01 am, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
                wrote:
                >
                >
                >
                >
                >
                On Aug 25, 4:06 pm, rusty.lee.2...@ gmail.com wrote:
                >
                I have used DataRowVersion to find changes to rows in a DataTable.
                >
                -rusty
                >
                On Aug 25, 2:11 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
                wrote:
                >
                On Aug 25, 2:40 pm, JDeats <Jeremy.De...@g mail.comwrote:
                >
                On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
                wrote:
                >
                Hello:
                >
                We wrote an entire application where we add our DataRows to our
                DataTables immediately. However, we have to shut off our constraints
                to do this. We would like to use detached DataRows to circumvent this.
                >
                What do you normally do to track detached DataRows? Is there a way to
                retrieve them? or do I have to stored them in some temporary location?
                >
                Thanks for any input!
                ~Travis
                >
                Let me make sure I understand: So you're using "detached" DataRows
                stored in a collection of some sort outside your DataTable because if
                you added them to your DataTable it would violate an existing
                constraint and you want to know what the best way is to track deteched
                DataRows in general. There's just not enough context to the question
                to give a very useful answer, but I would imagine the worst solution
                would be circumventing the restraints on your DataTable.
                >
                Can you provide more detail?
                >
                Well, no, I can't. My question is very open. I know people use
                DataTables to track changes on their UIs.
                >
                I want to know how they track DataRows that haven't been added to the
                DataTable. If you don't store them somewhere, I don't know how to get
                them back. I am curious whether people store them in a List<DataRow>
                or if there is a more elegant solution.
                >
                Plain curiousity on how to do it.
                >
                Thanks,
                Travis- Hide quoted text -
                >
                - Show quoted text -- Hide quoted text -
                >
                - Show quoted text -
                >
                How can I quickly iterate over detached rows and add them to my
                DataTable?- Hide quoted text -
                >
                - Show quoted text -
                >
                I'm not sure I understand the question, but in general you add a
                DataRow to a DataTable with DataTable.Rows. Add(DataRow) method.   This
                implies that the row can be added to the table.  Basically the row you
                are adding has to have identical columns as the DataTable, I think.
                >
                You would have to describe what it is you want to iterate through.
                Are these datarows part of a collection or array?
                >
                -rusty- Hide quoted text -
                >
                - Show quoted text -
                I suppose my original question was: How do the Windows Form controls
                hold detached rows, such as the DataGridView. I realized after some
                research that the BindingSource keeps track of a single detached row
                automatically. When the next detached row is added, the current
                detached row is added. If you use the controls, the detached rows are
                tracked for you. Otherwise, you have to manage the detached rows
                yourself. There is no way to query a DataTable for all of its detached
                rows.

                Comment

                • rustylee

                  #9
                  Re: What's Better? Adding Incomplete DataRows or Leaving Detached

                  On Aug 27, 6:20 am, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
                  wrote:
                  On Aug 26, 4:32 pm, rustylee <rusty.lee.2... @gmail.comwrote :
                  >
                  >
                  >
                  >
                  >
                  On Aug 26, 8:01 am, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
                  wrote:
                  >
                  On Aug 25, 4:06 pm, rusty.lee.2...@ gmail.com wrote:
                  >
                  I have used DataRowVersion to find changes to rows in a DataTable.
                  >
                  -rusty
                  >
                  On Aug 25, 2:11 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
                  wrote:
                  >
                  On Aug 25, 2:40 pm, JDeats <Jeremy.De...@g mail.comwrote:
                  >
                  On Aug 25, 3:14 pm, "jehugalea...@g mail.com" <jehugalea...@g mail.com>
                  wrote:
                  >
                  Hello:
                  >
                  We wrote an entire application where we add our DataRows to our
                  DataTables immediately. However, we have to shut off our constraints
                  to do this. We would like to use detached DataRows to circumvent this.
                  >
                  What do you normally do to track detached DataRows? Is there a way to
                  retrieve them? or do I have to stored them in some temporary location?
                  >
                  Thanks for any input!
                  ~Travis
                  >
                  Let me make sure I understand: So you're using "detached" DataRows
                  stored in a collection of some sort outside your DataTable because if
                  you added them to your DataTable it would violate an existing
                  constraint and you want to know what the best way is to track deteched
                  DataRows in general. There's just not enough context to the question
                  to give a very useful answer, but I would imagine the worst solution
                  would be circumventing the restraints on your DataTable.
                  >
                  Can you provide more detail?
                  >
                  Well, no, I can't. My question is very open. I know people use
                  DataTables to track changes on their UIs.
                  >
                  I want to know how they track DataRows that haven't been added tothe
                  DataTable. If you don't store them somewhere, I don't know how toget
                  them back. I am curious whether people store them in a List<DataRow>
                  or if there is a more elegant solution.
                  >
                  Plain curiousity on how to do it.
                  >
                  Thanks,
                  Travis- Hide quoted text -
                  >
                  - Show quoted text -- Hide quoted text -
                  >
                  - Show quoted text -
                  >
                  How can I quickly iterate over detached rows and add them to my
                  DataTable?- Hide quoted text -
                  >
                  - Show quoted text -
                  >
                  I'm not sure I understand the question, but in general you add a
                  DataRow to a DataTable with DataTable.Rows. Add(DataRow) method.   This
                  implies that the row can be added to the table.  Basically the row you
                  are adding has to have identical columns as the DataTable, I think.
                  >
                  You would have to describe what it is you want to iterate through.
                  Are these datarows part of a collection or array?
                  >
                  -rusty- Hide quoted text -
                  >
                  - Show quoted text -
                  >
                  I suppose my original question was: How do the Windows Form controls
                  hold detached rows, such as the DataGridView. I realized after some
                  research that the BindingSource keeps track of a single detached row
                  automatically. When the next detached row is added, the current
                  detached row is added. If you use the controls, the detached rows are
                  tracked for you. Otherwise, you have to manage the detached rows
                  yourself. There is no way to query a DataTable for all of its detached
                  rows.- Hide quoted text -
                  >
                  - Show quoted text -
                  I see. I'm going to look into that (which rows were added). One
                  thing that you should be able to do is capture an event where a new
                  row is added and track that way.
                  -rusty

                  Comment

                  Working...