PC Review


Reply
Thread Tools Rate Thread

Do I have to check RowState Detached

 
 
Tony Johansson
Guest
Posts: n/a
 
      3rd May 2009
Hello!

I have a DataGridView that represent a DataTable with some DataRow.
I have also these bindings.
_bindingSource.DataSource = _dataTable;
dataGridViewWareHouse.DataSource = _bindingSource;

When clicking on the Save button I write to a textfile.

Now to my question when I Change,Add or delete rows in the DataGridView do I
ever
have to check the rowState Detached.

//Tony


 
Reply With Quote
 
 
 
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      3rd May 2009
Tony,

Is it possible that you stay in the same message, because today you have
made more related message.

Don't be afraid, this will be seen by others too, but then they know what
you are doing,

By the way, what we don't know yet is, are you rewriting the complete
textfile or only the changed rows?

Cor

"Tony Johansson" <(E-Mail Removed)> wrote in message
news:eCgLl.8416$(E-Mail Removed)...
> Hello!
>
> I have a DataGridView that represent a DataTable with some DataRow.
> I have also these bindings.
> _bindingSource.DataSource = _dataTable;
> dataGridViewWareHouse.DataSource = _bindingSource;
>
> When clicking on the Save button I write to a textfile.
>
> Now to my question when I Change,Add or delete rows in the DataGridView do
> I ever
> have to check the rowState Detached.
>
> //Tony
>


 
Reply With Quote
 
Tony Johansson
Guest
Posts: n/a
 
      3rd May 2009
Hello!

I will do one of these alternatives.
1. Add new rows to the Textfile which mean new products.
2. Change existing products for example change the number of items for a
particularly product.
3. Delete a product from the file.

//Tony


"Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
news:eePsE9$(E-Mail Removed)...
> Tony,
>
> Is it possible that you stay in the same message, because today you have
> made more related message.
>
> Don't be afraid, this will be seen by others too, but then they know what
> you are doing,
>
> By the way, what we don't know yet is, are you rewriting the complete
> textfile or only the changed rows?
>
> Cor
>
> "Tony Johansson" <(E-Mail Removed)> wrote in message
> news:eCgLl.8416$(E-Mail Removed)...
>> Hello!
>>
>> I have a DataGridView that represent a DataTable with some DataRow.
>> I have also these bindings.
>> _bindingSource.DataSource = _dataTable;
>> dataGridViewWareHouse.DataSource = _bindingSource;
>>
>> When clicking on the Save button I write to a textfile.
>>
>> Now to my question when I Change,Add or delete rows in the DataGridView
>> do I ever
>> have to check the rowState Detached.
>>
>> //Tony
>>

>



 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      3rd May 2009
Tony,

Then first try to find how you do that to a textfile.

Cor

"Tony Johansson" <(E-Mail Removed)> wrote in message
news:4CiLl.8418$(E-Mail Removed)...
> Hello!
>
> I will do one of these alternatives.
> 1. Add new rows to the Textfile which mean new products.
> 2. Change existing products for example change the number of items for a
> particularly product.
> 3. Delete a product from the file.
>
> //Tony
>
>
> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
> news:eePsE9$(E-Mail Removed)...
>> Tony,
>>
>> Is it possible that you stay in the same message, because today you have
>> made more related message.
>>
>> Don't be afraid, this will be seen by others too, but then they know what
>> you are doing,
>>
>> By the way, what we don't know yet is, are you rewriting the complete
>> textfile or only the changed rows?
>>
>> Cor
>>
>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>> news:eCgLl.8416$(E-Mail Removed)...
>>> Hello!
>>>
>>> I have a DataGridView that represent a DataTable with some DataRow.
>>> I have also these bindings.
>>> _bindingSource.DataSource = _dataTable;
>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>
>>> When clicking on the Save button I write to a textfile.
>>>
>>> Now to my question when I Change,Add or delete rows in the DataGridView
>>> do I ever
>>> have to check the rowState Detached.
>>>
>>> //Tony
>>>

>>

>
>


 
Reply With Quote
 
Tony Johansson
Guest
Posts: n/a
 
      3rd May 2009
Hello!

When I delete a row from the DataGridView how can I get this row so I have a
change to remove
it from the textfile.
I use a DataGridView to represent the DataTable with its DataRows
In addition I use
_bindingSource.DataSource = _dataTable;
dataGridViewWareHouse.DataSource = _bindingSource;

//Tony


"Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
news:(E-Mail Removed)...
> Tony,
>
> Then first try to find how you do that to a textfile.
>
> Cor
>
> "Tony Johansson" <(E-Mail Removed)> wrote in message
> news:4CiLl.8418$(E-Mail Removed)...
>> Hello!
>>
>> I will do one of these alternatives.
>> 1. Add new rows to the Textfile which mean new products.
>> 2. Change existing products for example change the number of items for a
>> particularly product.
>> 3. Delete a product from the file.
>>
>> //Tony
>>
>>
>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>> news:eePsE9$(E-Mail Removed)...
>>> Tony,
>>>
>>> Is it possible that you stay in the same message, because today you have
>>> made more related message.
>>>
>>> Don't be afraid, this will be seen by others too, but then they know
>>> what you are doing,
>>>
>>> By the way, what we don't know yet is, are you rewriting the complete
>>> textfile or only the changed rows?
>>>
>>> Cor
>>>
>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>> news:eCgLl.8416$(E-Mail Removed)...
>>>> Hello!
>>>>
>>>> I have a DataGridView that represent a DataTable with some DataRow.
>>>> I have also these bindings.
>>>> _bindingSource.DataSource = _dataTable;
>>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>>
>>>> When clicking on the Save button I write to a textfile.
>>>>
>>>> Now to my question when I Change,Add or delete rows in the DataGridView
>>>> do I ever
>>>> have to check the rowState Detached.
>>>>
>>>> //Tony
>>>>
>>>

>>
>>

>



 
Reply With Quote
 
Tony Johansson
Guest
Posts: n/a
 
      3rd May 2009
Hello

I saw I could use this DataRowVersion.Original on a DataRow like this
string prodNo = (string)row["ProdNr", DataRowVersion.Original].ToString();


//Tony
"Tony Johansson" <(E-Mail Removed)> skrev i meddelandet
news:UkkLl.8420$(E-Mail Removed)...
> Hello!
>
> When I delete a row from the DataGridView how can I get this row so I have
> a change to remove
> it from the textfile.
> I use a DataGridView to represent the DataTable with its DataRows
> In addition I use
> _bindingSource.DataSource = _dataTable;
> dataGridViewWareHouse.DataSource = _bindingSource;
>
> //Tony
>
>
> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
> news:(E-Mail Removed)...
>> Tony,
>>
>> Then first try to find how you do that to a textfile.
>>
>> Cor
>>
>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>> news:4CiLl.8418$(E-Mail Removed)...
>>> Hello!
>>>
>>> I will do one of these alternatives.
>>> 1. Add new rows to the Textfile which mean new products.
>>> 2. Change existing products for example change the number of items for a
>>> particularly product.
>>> 3. Delete a product from the file.
>>>
>>> //Tony
>>>
>>>
>>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>>> news:eePsE9$(E-Mail Removed)...
>>>> Tony,
>>>>
>>>> Is it possible that you stay in the same message, because today you
>>>> have made more related message.
>>>>
>>>> Don't be afraid, this will be seen by others too, but then they know
>>>> what you are doing,
>>>>
>>>> By the way, what we don't know yet is, are you rewriting the complete
>>>> textfile or only the changed rows?
>>>>
>>>> Cor
>>>>
>>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>>> news:eCgLl.8416$(E-Mail Removed)...
>>>>> Hello!
>>>>>
>>>>> I have a DataGridView that represent a DataTable with some DataRow.
>>>>> I have also these bindings.
>>>>> _bindingSource.DataSource = _dataTable;
>>>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>>>
>>>>> When clicking on the Save button I write to a textfile.
>>>>>
>>>>> Now to my question when I Change,Add or delete rows in the
>>>>> DataGridView do I ever
>>>>> have to check the rowState Detached.
>>>>>
>>>>> //Tony
>>>>>
>>>>
>>>
>>>

>>

>
>



 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      4th May 2009
Tony,

I am very curious how you do that removing and adding of rows to your
textfile.

Cor

"Tony Johansson" <(E-Mail Removed)> wrote in message
news:kunLl.8422$(E-Mail Removed)...
> Hello
>
> I saw I could use this DataRowVersion.Original on a DataRow like this
> string prodNo = (string)row["ProdNr", DataRowVersion.Original].ToString();
>
>
> //Tony
> "Tony Johansson" <(E-Mail Removed)> skrev i meddelandet
> news:UkkLl.8420$(E-Mail Removed)...
>> Hello!
>>
>> When I delete a row from the DataGridView how can I get this row so I
>> have a change to remove
>> it from the textfile.
>> I use a DataGridView to represent the DataTable with its DataRows
>> In addition I use
>> _bindingSource.DataSource = _dataTable;
>> dataGridViewWareHouse.DataSource = _bindingSource;
>>
>> //Tony
>>
>>
>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>> news:(E-Mail Removed)...
>>> Tony,
>>>
>>> Then first try to find how you do that to a textfile.
>>>
>>> Cor
>>>
>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>> news:4CiLl.8418$(E-Mail Removed)...
>>>> Hello!
>>>>
>>>> I will do one of these alternatives.
>>>> 1. Add new rows to the Textfile which mean new products.
>>>> 2. Change existing products for example change the number of items for
>>>> a particularly product.
>>>> 3. Delete a product from the file.
>>>>
>>>> //Tony
>>>>
>>>>
>>>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>>>> news:eePsE9$(E-Mail Removed)...
>>>>> Tony,
>>>>>
>>>>> Is it possible that you stay in the same message, because today you
>>>>> have made more related message.
>>>>>
>>>>> Don't be afraid, this will be seen by others too, but then they know
>>>>> what you are doing,
>>>>>
>>>>> By the way, what we don't know yet is, are you rewriting the complete
>>>>> textfile or only the changed rows?
>>>>>
>>>>> Cor
>>>>>
>>>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>>>> news:eCgLl.8416$(E-Mail Removed)...
>>>>>> Hello!
>>>>>>
>>>>>> I have a DataGridView that represent a DataTable with some DataRow.
>>>>>> I have also these bindings.
>>>>>> _bindingSource.DataSource = _dataTable;
>>>>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>>>>
>>>>>> When clicking on the Save button I write to a textfile.
>>>>>>
>>>>>> Now to my question when I Change,Add or delete rows in the
>>>>>> DataGridView do I ever
>>>>>> have to check the rowState Detached.
>>>>>>
>>>>>> //Tony
>>>>>>
>>>>>
>>>>
>>>>
>>>

>>
>>

>
>


 
Reply With Quote
 
Tony Johansson
Guest
Posts: n/a
 
      4th May 2009
Hello!

So if I will add a new product I just use append to the textfile.
So if I will remove a product I create a temporary file on Path and then
looping and writing to tempfile
and when I find don't write and then I use suitable File.
So if I have to change I do similar thing with the textfile but I insted
write the changes back.

Hope you understand what I mean.


//Tony

"Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
news:eOa$(E-Mail Removed)...
> Tony,
>
> I am very curious how you do that removing and adding of rows to your
> textfile.
>
> Cor
>
> "Tony Johansson" <(E-Mail Removed)> wrote in message
> news:kunLl.8422$(E-Mail Removed)...
>> Hello
>>
>> I saw I could use this DataRowVersion.Original on a DataRow like this
>> string prodNo = (string)row["ProdNr",
>> DataRowVersion.Original].ToString();
>>
>>
>> //Tony
>> "Tony Johansson" <(E-Mail Removed)> skrev i meddelandet
>> news:UkkLl.8420$(E-Mail Removed)...
>>> Hello!
>>>
>>> When I delete a row from the DataGridView how can I get this row so I
>>> have a change to remove
>>> it from the textfile.
>>> I use a DataGridView to represent the DataTable with its DataRows
>>> In addition I use
>>> _bindingSource.DataSource = _dataTable;
>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>
>>> //Tony
>>>
>>>
>>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>>> news:(E-Mail Removed)...
>>>> Tony,
>>>>
>>>> Then first try to find how you do that to a textfile.
>>>>
>>>> Cor
>>>>
>>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>>> news:4CiLl.8418$(E-Mail Removed)...
>>>>> Hello!
>>>>>
>>>>> I will do one of these alternatives.
>>>>> 1. Add new rows to the Textfile which mean new products.
>>>>> 2. Change existing products for example change the number of items for
>>>>> a particularly product.
>>>>> 3. Delete a product from the file.
>>>>>
>>>>> //Tony
>>>>>
>>>>>
>>>>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>>>>> news:eePsE9$(E-Mail Removed)...
>>>>>> Tony,
>>>>>>
>>>>>> Is it possible that you stay in the same message, because today you
>>>>>> have made more related message.
>>>>>>
>>>>>> Don't be afraid, this will be seen by others too, but then they know
>>>>>> what you are doing,
>>>>>>
>>>>>> By the way, what we don't know yet is, are you rewriting the complete
>>>>>> textfile or only the changed rows?
>>>>>>
>>>>>> Cor
>>>>>>
>>>>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>>>>> news:eCgLl.8416$(E-Mail Removed)...
>>>>>>> Hello!
>>>>>>>
>>>>>>> I have a DataGridView that represent a DataTable with some DataRow.
>>>>>>> I have also these bindings.
>>>>>>> _bindingSource.DataSource = _dataTable;
>>>>>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>>>>>
>>>>>>> When clicking on the Save button I write to a textfile.
>>>>>>>
>>>>>>> Now to my question when I Change,Add or delete rows in the
>>>>>>> DataGridView do I ever
>>>>>>> have to check the rowState Detached.
>>>>>>>
>>>>>>> //Tony
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>

>>
>>

>



 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      4th May 2009
Tony,

Then as I understand you well for the same, you can simply write a new file,
because that has the same effect.

(And don't forget then to create a temp file before you start writing the
new one)

In my idea will that go much quicker while it is easier to do.

Be aware that you cannot use both solutions with more then 1 user active at
a time.

Cor

"Tony Johansson" <(E-Mail Removed)> wrote in message
news:hwxLl.8426$(E-Mail Removed)...
> Hello!
>
> So if I will add a new product I just use append to the textfile.
> So if I will remove a product I create a temporary file on Path and then
> looping and writing to tempfile
> and when I find don't write and then I use suitable File.
> So if I have to change I do similar thing with the textfile but I insted
> write the changes back.
>
> Hope you understand what I mean.
>
>
> //Tony
>
> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
> news:eOa$(E-Mail Removed)...
>> Tony,
>>
>> I am very curious how you do that removing and adding of rows to your
>> textfile.
>>
>> Cor
>>
>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>> news:kunLl.8422$(E-Mail Removed)...
>>> Hello
>>>
>>> I saw I could use this DataRowVersion.Original on a DataRow like this
>>> string prodNo = (string)row["ProdNr",
>>> DataRowVersion.Original].ToString();
>>>
>>>
>>> //Tony
>>> "Tony Johansson" <(E-Mail Removed)> skrev i meddelandet
>>> news:UkkLl.8420$(E-Mail Removed)...
>>>> Hello!
>>>>
>>>> When I delete a row from the DataGridView how can I get this row so I
>>>> have a change to remove
>>>> it from the textfile.
>>>> I use a DataGridView to represent the DataTable with its DataRows
>>>> In addition I use
>>>> _bindingSource.DataSource = _dataTable;
>>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>>
>>>> //Tony
>>>>
>>>>
>>>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>>>> news:(E-Mail Removed)...
>>>>> Tony,
>>>>>
>>>>> Then first try to find how you do that to a textfile.
>>>>>
>>>>> Cor
>>>>>
>>>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>>>> news:4CiLl.8418$(E-Mail Removed)...
>>>>>> Hello!
>>>>>>
>>>>>> I will do one of these alternatives.
>>>>>> 1. Add new rows to the Textfile which mean new products.
>>>>>> 2. Change existing products for example change the number of items
>>>>>> for a particularly product.
>>>>>> 3. Delete a product from the file.
>>>>>>
>>>>>> //Tony
>>>>>>
>>>>>>
>>>>>> "Cor Ligthert[MVP]" <(E-Mail Removed)> skrev i meddelandet
>>>>>> news:eePsE9$(E-Mail Removed)...
>>>>>>> Tony,
>>>>>>>
>>>>>>> Is it possible that you stay in the same message, because today you
>>>>>>> have made more related message.
>>>>>>>
>>>>>>> Don't be afraid, this will be seen by others too, but then they know
>>>>>>> what you are doing,
>>>>>>>
>>>>>>> By the way, what we don't know yet is, are you rewriting the
>>>>>>> complete textfile or only the changed rows?
>>>>>>>
>>>>>>> Cor
>>>>>>>
>>>>>>> "Tony Johansson" <(E-Mail Removed)> wrote in message
>>>>>>> news:eCgLl.8416$(E-Mail Removed)...
>>>>>>>> Hello!
>>>>>>>>
>>>>>>>> I have a DataGridView that represent a DataTable with some DataRow.
>>>>>>>> I have also these bindings.
>>>>>>>> _bindingSource.DataSource = _dataTable;
>>>>>>>> dataGridViewWareHouse.DataSource = _bindingSource;
>>>>>>>>
>>>>>>>> When clicking on the Save button I write to a textfile.
>>>>>>>>
>>>>>>>> Now to my question when I Change,Add or delete rows in the
>>>>>>>> DataGridView do I ever
>>>>>>>> have to check the rowState Detached.
>>>>>>>>
>>>>>>>> //Tony
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Still detached after update Ken Microsoft Dot NET Framework 1 13th Feb 2009 06:21 AM
Detached Event Procedures Neil Microsoft Access 1 18th Apr 2007 11:12 PM
DWT's becoming detached =?Utf-8?B?cmljaGFyZGVsYTIx?= Microsoft Frontpage 3 13th Oct 2006 02:09 PM
NewRow, RowState, and Detached with a CommandBuilder Andy Microsoft ADO .NET 1 31st Aug 2006 06:59 PM
RowState how to check it ? Jarod Microsoft ASP .NET 0 6th Jun 2006 07:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:58 PM.