Home All Groups Group Topic Archive Search About

DataSet Clear slow performance in C# 2.0

Author
8 Feb 2007 12:50 PM
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

Author
8 Feb 2007 2:27 PM
Patrick Steele
In article <Ov8No#3SHHA.4***@TK2MSFTNGP06.phx.gbl>,
ar***@mipapeleria.com says...
> 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?

Author
8 Feb 2007 3:32 PM
Armando Ruiz
Thanks for your quick response.

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

Armando




Show quote
"Patrick Steele" <patr***@mvps.org> escribió en el mensaje
news:MPG.2034fd48c132a8399896e6@msnews.microsoft.com...
> In article <Ov8No#3SHHA.4***@TK2MSFTNGP06.phx.gbl>,
> ar***@mipapeleria.com says...
>> 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?
>
> --
> Patrick Steele
> http://weblogs.asp.net/psteele
Author
8 Feb 2007 7:53 PM
Patrick Steele
In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
ar***@mipapeleria.com says...
> 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?

Author
9 Feb 2007 8:40 AM
Armando Ruiz
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

Show quote
"Patrick Steele" <patr***@mvps.org> escribió en el mensaje
news:MPG.203549e3eecc4289896ed@msnews.microsoft.com...
> In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
> ar***@mipapeleria.com says...
>> 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?
>
> --
> Patrick Steele
> http://weblogs.asp.net/psteele
Author
9 Feb 2007 11:31 PM
RobinS
Are you using a Binding Source with your data bindings?

Robin S.
---------------------------
Show quote
"Armando Ruiz" <ar***@mipapeleria.com> wrote in message
news:%23EhzsXCTHHA.3996@TK2MSFTNGP04.phx.gbl...
> 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" <patr***@mvps.org> escribió en el mensaje
> news:MPG.203549e3eecc4289896ed@msnews.microsoft.com...
>> In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
>> ar***@mipapeleria.com says...
>>> 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?
>>
>> --
>> Patrick Steele
>> http://weblogs.asp.net/psteele
>
>
Author
10 Feb 2007 6:54 PM
aruiz
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.


Show quote
"RobinS" <RobinS@NoSpam.yah.none> escribió en el mensaje
news:HvWdnXI0y9WmmVDYnZ2dnUVZ_rSjnZ2d@comcast.com...
> Are you using a Binding Source with your data bindings?
>
> Robin S.
> ---------------------------
> "Armando Ruiz" <ar***@mipapeleria.com> wrote in message
> news:%23EhzsXCTHHA.3996@TK2MSFTNGP04.phx.gbl...
>> 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" <patr***@mvps.org> escribió en el mensaje
>> news:MPG.203549e3eecc4289896ed@msnews.microsoft.com...
>>> In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
>>> ar***@mipapeleria.com says...
>>>> 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?
>>>
>>> --
>>> Patrick Steele
>>> http://weblogs.asp.net/psteele
>>
>>
>
>
Author
11 Feb 2007 2:15 PM
Cor Ligthert [MVP]
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

<ar***@mipapeleria.com> schreef in bericht
Show quote
news:e9tT7VUTHHA.600@TK2MSFTNGP05.phx.gbl...
>
> 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" <RobinS@NoSpam.yah.none> escribió en el mensaje
> news:HvWdnXI0y9WmmVDYnZ2dnUVZ_rSjnZ2d@comcast.com...
>> Are you using a Binding Source with your data bindings?
>>
>> Robin S.
>> ---------------------------
>> "Armando Ruiz" <ar***@mipapeleria.com> wrote in message
>> news:%23EhzsXCTHHA.3996@TK2MSFTNGP04.phx.gbl...
>>> 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" <patr***@mvps.org> escribió en el mensaje
>>> news:MPG.203549e3eecc4289896ed@msnews.microsoft.com...
>>>> In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
>>>> ar***@mipapeleria.com says...
>>>>> 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?
>>>>
>>>> --
>>>> Patrick Steele
>>>> http://weblogs.asp.net/psteele
>>>
>>>
>>
>>
>
>
Author
11 Feb 2007 7:36 PM
RobinS
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.
-----------------------------------------------
<ar***@mipapeleria.com> wrote in message
Show quote
news:e9tT7VUTHHA.600@TK2MSFTNGP05.phx.gbl...
>
> 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" <RobinS@NoSpam.yah.none> escribió en el mensaje
> news:HvWdnXI0y9WmmVDYnZ2dnUVZ_rSjnZ2d@comcast.com...
>> Are you using a Binding Source with your data bindings?
>>
>> Robin S.
>> ---------------------------
>> "Armando Ruiz" <ar***@mipapeleria.com> wrote in message
>> news:%23EhzsXCTHHA.3996@TK2MSFTNGP04.phx.gbl...
>>> 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" <patr***@mvps.org> escribió en el mensaje
>>> news:MPG.203549e3eecc4289896ed@msnews.microsoft.com...
>>>> In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
>>>> ar***@mipapeleria.com says...
>>>>> 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?
>>>>
>>>> --
>>>> Patrick Steele
>>>> http://weblogs.asp.net/psteele
>>>
>>>
>>
>>
>
>
Author
12 Feb 2007 8:47 AM
Armando Ruiz
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.



Show quote
"RobinS" <RobinS@NoSpam.yah.none> escribió en el mensaje
news:GqOdnWdfgrGq7VLYnZ2dnUVZ_t6qnZ2d@comcast.com...
> 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.
> -----------------------------------------------
> <ar***@mipapeleria.com> wrote in message
> news:e9tT7VUTHHA.600@TK2MSFTNGP05.phx.gbl...
>>
>> 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" <RobinS@NoSpam.yah.none> escribió en el mensaje
>> news:HvWdnXI0y9WmmVDYnZ2dnUVZ_rSjnZ2d@comcast.com...
>>> Are you using a Binding Source with your data bindings?
>>>
>>> Robin S.
>>> ---------------------------
>>> "Armando Ruiz" <ar***@mipapeleria.com> wrote in message
>>> news:%23EhzsXCTHHA.3996@TK2MSFTNGP04.phx.gbl...
>>>> 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" <patr***@mvps.org> escribió en el mensaje
>>>> news:MPG.203549e3eecc4289896ed@msnews.microsoft.com...
>>>>> In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
>>>>> ar***@mipapeleria.com says...
>>>>>> 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?
>>>>>
>>>>> --
>>>>> Patrick Steele
>>>>> http://weblogs.asp.net/psteele
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
13 Feb 2007 1:30 AM
RobinS
Cool. I figured it would resolve the problem, but wasn't 100% sure. Thanks
for letting me know.

Robin S.
-------------------------------
Show quote
"Armando Ruiz" <ar***@mipapeleria.com> wrote in message
news:ezQi9JoTHHA.480@TK2MSFTNGP02.phx.gbl...
> 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" <RobinS@NoSpam.yah.none> escribió en el mensaje
> news:GqOdnWdfgrGq7VLYnZ2dnUVZ_t6qnZ2d@comcast.com...
>> 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.
>> -----------------------------------------------
>> <ar***@mipapeleria.com> wrote in message
>> news:e9tT7VUTHHA.600@TK2MSFTNGP05.phx.gbl...
>>>
>>> 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" <RobinS@NoSpam.yah.none> escribió en el mensaje
>>> news:HvWdnXI0y9WmmVDYnZ2dnUVZ_rSjnZ2d@comcast.com...
>>>> Are you using a Binding Source with your data bindings?
>>>>
>>>> Robin S.
>>>> ---------------------------
>>>> "Armando Ruiz" <ar***@mipapeleria.com> wrote in message
>>>> news:%23EhzsXCTHHA.3996@TK2MSFTNGP04.phx.gbl...
>>>>> 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" <patr***@mvps.org> escribió en el mensaje
>>>>> news:MPG.203549e3eecc4289896ed@msnews.microsoft.com...
>>>>>> In article <#rYprZ5SHHA.3***@TK2MSFTNGP02.phx.gbl>,
>>>>>> ar***@mipapeleria.com says...
>>>>>>> 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?
>>>>>>
>>>>>> --
>>>>>> Patrick Steele
>>>>>> http://weblogs.asp.net/psteele
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

AddThis Social Bookmark Button