471,316 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

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
Aug 25 '08 #1
8 1867
On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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?
Aug 25 '08 #2
On Aug 25, 2:40*pm, JDeats <Jeremy.De...@gmail.comwrote:
On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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
Aug 25 '08 #3
I have used DataRowVersion to find changes to rows in a DataTable.

-rusty
On Aug 25, 2:11*pm, "jehugalea...@gmail.com" <jehugalea...@gmail.com>
wrote:
On Aug 25, 2:40*pm, JDeats <Jeremy.De...@gmail.comwrote:


On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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 -
Aug 25 '08 #4
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...@gmail.com" <jehugalea...@gmail.com>
wrote:
On Aug 25, 2:40*pm, JDeats <Jeremy.De...@gmail.comwrote:
On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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!
Aug 26 '08 #5
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...@gmail.com" <jehugalea...@gmail.com>
wrote:
On Aug 25, 2:40*pm, JDeats <Jeremy.De...@gmail.comwrote:
On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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?
Aug 26 '08 #6
On Aug 26, 8:01*am, "jehugalea...@gmail.com" <jehugalea...@gmail.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...@gmail.com" <jehugalea...@gmail.com>
wrote:
On Aug 25, 2:40*pm, JDeats <Jeremy.De...@gmail.comwrote:
On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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

Aug 26 '08 #7
On Aug 26, 4:32*pm, rustylee <rusty.lee.2...@gmail.comwrote:
On Aug 26, 8:01*am, "jehugalea...@gmail.com" <jehugalea...@gmail.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...@gmail.com" <jehugalea...@gmail.com>
wrote:
On Aug 25, 2:40*pm, JDeats <Jeremy.De...@gmail.comwrote:
On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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.
Aug 27 '08 #8
On Aug 27, 6:20*am, "jehugalea...@gmail.com" <jehugalea...@gmail.com>
wrote:
On Aug 26, 4:32*pm, rustylee <rusty.lee.2...@gmail.comwrote:


On Aug 26, 8:01*am, "jehugalea...@gmail.com" <jehugalea...@gmail.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...@gmail.com" <jehugalea...@gmail.com>
wrote:
On Aug 25, 2:40*pm, JDeats <Jeremy.De...@gmail.comwrote:
On Aug 25, 3:14 pm, "jehugalea...@gmail.com" <jehugalea...@gmail.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
Aug 27 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

220 posts views Thread by Brandon J. Van Every | last post: by
7 posts views Thread by Michele Simionato | last post: by
51 posts views Thread by jacob navia | last post: by
5 posts views Thread by jurson | last post: by
30 posts views Thread by Alper AKCAYOZ | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.