DataSet Clear slow performance in C# 2.0

  • Thread starter Thread starter Armando Ruiz
  • Start date Start date
A

Armando Ruiz

Hello group

I`m testing a Vs2003 application (C#) migrated to Vs2005 and I´ve found
that
when I do a DataSet.Clear(), the C# 2.0 has a very slow performance
deleting the rows, while the same process in C# 1.1 runs faster. (5 segs.
faster!)

Does anybody knows someting about this issue?

Thanks in advanced.

Armando
 
Hello group

I`m testing a Vs2003 application (C#) migrated to Vs2005 and I=3Fve found
that
when I do a DataSet.Clear(), the C# 2.0 has a very slow performance
deleting the rows, while the same process in C# 1.1 runs faster. (5 segs.
faster!)

Does anybody knows someting about this issue?

I've never heard of this issue, and I don't do a lot with Datasets.
However, are you seeing this slowdown running in Release mode outside of
the IDE? Or is this timing while in Debug mode inside the VS.NET IDE?
 
Thanks for your quick response.

Both of them are in release mode and outside VS.Net IDE.

Armando
 
Thanks for your quick response.

Both of them are in release mode and outside VS.Net IDE.

Armando

Arggh... Hmmm.. And they are both accessing the same dataset, against
the same database? Sorry, I'm at a loss as to what could be causing
such a noticeable slowdown.

Have you noticed this on more than one machine?
 
Hello again.

Last night I've been testing the process step by step and I?ve found that if
I dont do the Databinding process
with the text controls (nor the grid) the Clear() and Merge() methods runs
as faster as in the Vs2003 model.

The problem must be in the binding of the textbox controls but I dont know
if there are changes in framework 2.0. to make a slower databinding. in
applications.

Thanks
 
Are you using a Binding Source with your data bindings?

Robin S.
---------------------------
Armando Ruiz said:
Hello again.

Last night I've been testing the process step by step and I?ve found that
if I dont do the Databinding process
with the text controls (nor the grid) the Clear() and Merge() methods
runs as faster as in the Vs2003 model.

The problem must be in the binding of the textbox controls but I dont
know if there are changes in framework 2.0. to make a slower
databinding. in applications.

Thanks
 
No, the code is exactly the same as in Vs2003.
There´s one method which bind each control after initializecomponent like:

this.[textControl].DataBindings.Add("Text", DataView,"idCompany")

When the user look for new data, I call the Clear and Merge methods.


RobinS said:
Are you using a Binding Source with your data bindings?

Robin S.
---------------------------
 
Armando

It is very strange, one of the things that should be repaired with version
2.0 was the very slow deleting, clearing etc with rows. (With version 1.1 it
was in some couses to delete everything and than add again what stayed).

Therefore can you show us a piece of code that shows this. Or build yourself
a little application what does the essential.

Cor

No, the code is exactly the same as in Vs2003.
There´s one method which bind each control after initializecomponent like:

this.[textControl].DataBindings.Add("Text", DataView,"idCompany")

When the user look for new data, I call the Clear and Merge methods.


RobinS said:
Are you using a Binding Source with your data bindings?

Robin S.
 
You might consider adding a BindingSource and see if that has any impact.

What you do is bind the binding source to the data source, then bind the
controls to the binding source. For example:

myBindingSource.DataSource = myDataSet.Tables("Customers")

this.[TextControl].DataBindings.Add("Text", myBindingSource, "idCompany")

When you change the dataset behind the bindings, the Binding Source handles
the update of the controls separately. This might happen a lot quicker
using a Binding Source than it does without one, because it provides some
glue in the middle.

It's free to try it. If it works, let us know.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
No, the code is exactly the same as in Vs2003.
There´s one method which bind each control after initializecomponent
like:

this.[textControl].DataBindings.Add("Text", DataView,"idCompany")

When the user look for new data, I call the Clear and Merge methods.


RobinS said:
Are you using a Binding Source with your data bindings?

Robin S.
 
Hello again and thanks for the clue.

I've changed the code adding a BindingSource and everything seems to works
fine.
I need to do some additional test, but looks like doing databinding directly
to the DataSet
"locks" some methods like Clear()

Thanks for your help

Armando.



RobinS said:
You might consider adding a BindingSource and see if that has any impact.

What you do is bind the binding source to the data source, then bind the
controls to the binding source. For example:

myBindingSource.DataSource = myDataSet.Tables("Customers")

this.[TextControl].DataBindings.Add("Text", myBindingSource, "idCompany")

When you change the dataset behind the bindings, the Binding Source
handles the update of the controls separately. This might happen a lot
quicker using a Binding Source than it does without one, because it
provides some glue in the middle.

It's free to try it. If it works, let us know.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
No, the code is exactly the same as in Vs2003.
There´s one method which bind each control after initializecomponent
like:

this.[textControl].DataBindings.Add("Text", DataView,"idCompany")

When the user look for new data, I call the Clear and Merge methods.


RobinS said:
Are you using a Binding Source with your data bindings?

Robin S.
---------------------------
Hello again.

Last night I've been testing the process step by step and I?ve found
that if I dont do the Databinding process
with the text controls (nor the grid) the Clear() and Merge() methods
runs as faster as in the Vs2003 model.

The problem must be in the binding of the textbox controls but I dont
know if there are changes in framework 2.0. to make a slower
databinding. in applications.

Thanks

"Patrick Steele" <[email protected]> escribió en el mensaje
Thanks for your quick response.

Both of them are in release mode and outside VS.Net IDE.

Armando

Arggh... Hmmm.. And they are both accessing the same dataset, against
the same database? Sorry, I'm at a loss as to what could be causing
such a noticeable slowdown.

Have you noticed this on more than one machine?
 
Cool. I figured it would resolve the problem, but wasn't 100% sure. Thanks
for letting me know.

Robin S.
-------------------------------
Armando Ruiz said:
Hello again and thanks for the clue.

I've changed the code adding a BindingSource and everything seems to
works fine.
I need to do some additional test, but looks like doing databinding
directly to the DataSet
"locks" some methods like Clear()

Thanks for your help

Armando.



RobinS said:
You might consider adding a BindingSource and see if that has any
impact.

What you do is bind the binding source to the data source, then bind the
controls to the binding source. For example:

myBindingSource.DataSource = myDataSet.Tables("Customers")

this.[TextControl].DataBindings.Add("Text", myBindingSource,
"idCompany")

When you change the dataset behind the bindings, the Binding Source
handles the update of the controls separately. This might happen a lot
quicker using a Binding Source than it does without one, because it
provides some glue in the middle.

It's free to try it. If it works, let us know.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
No, the code is exactly the same as in Vs2003.
There´s one method which bind each control after initializecomponent
like:

this.[textControl].DataBindings.Add("Text", DataView,"idCompany")

When the user look for new data, I call the Clear and Merge methods.


"RobinS" <[email protected]> escribió en el mensaje
Are you using a Binding Source with your data bindings?

Robin S.
---------------------------
Hello again.

Last night I've been testing the process step by step and I?ve found
that if I dont do the Databinding process
with the text controls (nor the grid) the Clear() and Merge() methods
runs as faster as in the Vs2003 model.

The problem must be in the binding of the textbox controls but I dont
know if there are changes in framework 2.0. to make a slower
databinding. in applications.

Thanks

"Patrick Steele" <[email protected]> escribió en el mensaje
Thanks for your quick response.

Both of them are in release mode and outside VS.Net IDE.

Armando

Arggh... Hmmm.. And they are both accessing the same dataset,
against
the same database? Sorry, I'm at a loss as to what could be causing
such a noticeable slowdown.

Have you noticed this on more than one machine?
 
Back
Top