PC Review


Reply
Thread Tools Rate Thread

Dataset refill issue - Stalls for 30 to 40 seconds

 
 
J. Clay
Guest
Posts: n/a
 
      16th Jun 2005
I have a typed dataset with three tables, one master and to child. This is
a contact management app, so I pull all of an organization contacts and
associated details into the set. (Anywhere from 1 to 100 contacts and their
associated detail). My form is bound to the dataset using VS2003 form
designer.

When I want to go to a contact in a different organization, I am trying to
do the following:

1) Clear the dataset using dataset.clear(0)
2) Refill The dataset with the new organization info using the original
adapters with the single paramete changed.
3) Use the CurrencyManager to find and set as current the specific contact I
am going to

This works fine except one MAJOR issue - I can fill the original set and go
to the contact fine. But, as soon as I try and change contacts, it hangs
for about 30 to 40 seconds before continuing on. After this first change,
it works great, with no delay. It is just in the FIRST clear and refill
that causes this issue.

I have tracked it down to specifically the Master table, but clearing each
table individually. I have even gone as far as to delete each row of the
master table individually, and it appears that it is hanging on the current
row. I have tried using SuspendBinding and ResumeBinding, but this did not
help.

If anyone has some ideas, I would greately appreciate it.

TIA,
Jim



 
Reply With Quote
 
 
 
 
W.G. Ryan eMVP
Guest
Posts: n/a
 
      16th Jun 2005
Could be a few things, but first, I'd try setting the BeginLoadData to false
at the onset, then turning it back on
http://msdn.microsoft.com/library/de...classtopic.asp

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"J. Clay" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a typed dataset with three tables, one master and to child. This

is
> a contact management app, so I pull all of an organization contacts and
> associated details into the set. (Anywhere from 1 to 100 contacts and

their
> associated detail). My form is bound to the dataset using VS2003 form
> designer.
>
> When I want to go to a contact in a different organization, I am trying to
> do the following:
>
> 1) Clear the dataset using dataset.clear(0)
> 2) Refill The dataset with the new organization info using the original
> adapters with the single paramete changed.
> 3) Use the CurrencyManager to find and set as current the specific contact

I
> am going to
>
> This works fine except one MAJOR issue - I can fill the original set and

go
> to the contact fine. But, as soon as I try and change contacts, it hangs
> for about 30 to 40 seconds before continuing on. After this first change,
> it works great, with no delay. It is just in the FIRST clear and refill
> that causes this issue.
>
> I have tracked it down to specifically the Master table, but clearing each
> table individually. I have even gone as far as to delete each row of the
> master table individually, and it appears that it is hanging on the

current
> row. I have tried using SuspendBinding and ResumeBinding, but this did

not
> help.
>
> If anyone has some ideas, I would greately appreciate it.
>
> TIA,
> Jim
>
>
>



 
Reply With Quote
 
J. Clay
Guest
Posts: n/a
 
      16th Jun 2005
Thanks for the reply, but unfortunetely, this didn't help.

Jim


"W.G. Ryan eMVP" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Could be a few things, but first, I'd try setting the BeginLoadData to

false
> at the onset, then turning it back on
>

http://msdn.microsoft.com/library/de...classtopic.asp
>
> --
> W.G. Ryan MVP (Windows Embedded)
>
> TiBA Solutions
> www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
> "J. Clay" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I have a typed dataset with three tables, one master and to child. This

> is
> > a contact management app, so I pull all of an organization contacts and
> > associated details into the set. (Anywhere from 1 to 100 contacts and

> their
> > associated detail). My form is bound to the dataset using VS2003 form
> > designer.
> >
> > When I want to go to a contact in a different organization, I am trying

to
> > do the following:
> >
> > 1) Clear the dataset using dataset.clear(0)
> > 2) Refill The dataset with the new organization info using the original
> > adapters with the single paramete changed.
> > 3) Use the CurrencyManager to find and set as current the specific

contact
> I
> > am going to
> >
> > This works fine except one MAJOR issue - I can fill the original set and

> go
> > to the contact fine. But, as soon as I try and change contacts, it

hangs
> > for about 30 to 40 seconds before continuing on. After this first

change,
> > it works great, with no delay. It is just in the FIRST clear and refill
> > that causes this issue.
> >
> > I have tracked it down to specifically the Master table, but clearing

each
> > table individually. I have even gone as far as to delete each row of

the
> > master table individually, and it appears that it is hanging on the

> current
> > row. I have tried using SuspendBinding and ResumeBinding, but this did

> not
> > help.
> >
> > If anyone has some ideas, I would greately appreciate it.
> >
> > TIA,
> > Jim
> >
> >
> >

>
>
>




 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      16th Jun 2005
Jay,

Are you sure that it is 30 to 40 seconds. I have seen as well that fore some
handling in ADONET is unfortunaly used the exception handling. What gives in
some occasions strange behaviour. However 30 to 40 seems for me very much.
It can be of course that you use a not very fast computer.

The effect you describe is typicall for exception handling.

This means not directly that you have errors. You can test it by using in
the debugger by setting the radiobutton for "when the exception is thrown"
to "break into the debugger". (after that you selected the section that you
are testing in the treeview above that).

(And don't forget to set it back afterwards, there are more parts in .Net
where this is used however than you will not be notice it. When you use
VBNet than you can see that it is by instance used in the function "IsDate",
however than the effect is almost invisible.)

I hope this gives some idea's

Cor


 
Reply With Quote
 
J. Clay
Guest
Posts: n/a
 
      16th Jun 2005
It is right at 40 seconds. And it is ONLY the FIRST time I clear and refill
the dataset. All subsequent times, I very fast. The computer should be
plenty fast. It's a 2.8Ghz w/1Gb Ram machine, and 80gb of harddrive, so I
don't think that's the issue.

Thanks for the tip on the debugger, It did NOT throw any exceptions at the
spot that is hanging, but I found a couple of other minor things I can deal
with later.

Any more suggestions???

Thanks,
Jim


"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Jay,
>
> Are you sure that it is 30 to 40 seconds. I have seen as well that fore

some
> handling in ADONET is unfortunaly used the exception handling. What gives

in
> some occasions strange behaviour. However 30 to 40 seems for me very much.
> It can be of course that you use a not very fast computer.
>
> The effect you describe is typicall for exception handling.
>
> This means not directly that you have errors. You can test it by using in
> the debugger by setting the radiobutton for "when the exception is thrown"
> to "break into the debugger". (after that you selected the section that

you
> are testing in the treeview above that).
>
> (And don't forget to set it back afterwards, there are more parts in .Net
> where this is used however than you will not be notice it. When you use
> VBNet than you can see that it is by instance used in the function

"IsDate",
> however than the effect is almost invisible.)
>
> I hope this gives some idea's
>
> Cor
>
>
>




 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      17th Jun 2005
Hi Jim,

There is a known issue that if you bind a CombBox to a DataTable or
DataSet, when refilling the data source, the filling process will hang. You
can try to set the DataSource property of the controls on the form to null
before re-filling. And set them back after filling to see if it can resolve
this issue.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
J. Clay
Guest
Posts: n/a
 
      17th Jun 2005
The one bound combo box is already unbound before trying to clear the combo
box. Another part of the puzzle is that I am using Duncan Mackenzie's
DataBound Tree Control. I HAVE tried unbinding it prior to clearing the
dataset, but that hasn't help either. Today, I am going to set up a form
only with text boxes and see what happens when I try to clear and refill the
dataset.

I have narrowed it down to the specific record in the main table that the
form is on is the one that is hanging. I determined this by deleting each
row individually rather that clearing the entire table. In stepping through
the code, every row was removed instantly except for the row that had
binding to it on the form.

The strangest part about this is that it only happens the first time I try
to clear the dataset. All subsequent times have no delay.

Thanks,
Jim


"Kevin Yu [MSFT]" <v-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Jim,
>
> There is a known issue that if you bind a CombBox to a DataTable or
> DataSet, when refilling the data source, the filling process will hang.

You
> can try to set the DataSource property of the controls on the form to null
> before re-filling. And set them back after filling to see if it can

resolve
> this issue.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>




 
Reply With Quote
 
J. Clay
Guest
Posts: n/a
 
      17th Jun 2005
oops...The first sentence should be ....before trying to clear the Dataset.


"J. Clay" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> The one bound combo box is already unbound before trying to clear the

combo
> box. Another part of the puzzle is that I am using Duncan Mackenzie's
> DataBound Tree Control. I HAVE tried unbinding it prior to clearing the
> dataset, but that hasn't help either. Today, I am going to set up a form
> only with text boxes and see what happens when I try to clear and refill

the
> dataset.
>
> I have narrowed it down to the specific record in the main table that the
> form is on is the one that is hanging. I determined this by deleting each
> row individually rather that clearing the entire table. In stepping

through
> the code, every row was removed instantly except for the row that had
> binding to it on the form.
>
> The strangest part about this is that it only happens the first time I try
> to clear the dataset. All subsequent times have no delay.
>
> Thanks,
> Jim
>
>
> "Kevin Yu [MSFT]" <v-(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi Jim,
> >
> > There is a known issue that if you bind a CombBox to a DataTable or
> > DataSet, when refilling the data source, the filling process will hang.

> You
> > can try to set the DataSource property of the controls on the form to

null
> > before re-filling. And set them back after filling to see if it can

> resolve
> > this issue.
> >
> > Kevin Yu
> > =======
> > "This posting is provided "AS IS" with no warranties, and confers no
> > rights."
> >
> >

>
>
>
>




 
Reply With Quote
 
J. Clay
Guest
Posts: n/a
 
      17th Jun 2005
After doing a bunch more testing, this is what I have found.

It is related to the combo box (I thought I had this dealt with). Here is
my code:

Private Sub FillContactDataSet(ByVal ContactID As Int32)
Try
Me.cmbAddress.DataSource = Nothing
Me.cmbAddress.DisplayMember = Nothing
Me.cmbAddress.ValueMember = Nothing
Me.dvAddress = Nothing

Me.ContactInfo1.Address.Clear()
Me.ContactInfo1.ContactDetails.Clear()
Me.ContactInfo1.ContactOrganizations.Clear()


Me.dadContactOrganizations.SelectCommand.Parameters("@ContactID").Value =
ContactID
Me.dadContactOrganizations.Fill(ContactInfo1.ContactOrganizations)

Me.dadContactDetails.SelectCommand.Parameters("@ContactID").Value =
ContactID
Me.dadContactDetails.Fill(ContactInfo1.ContactDetails)

Me.dadAddress.SelectCommand.Parameters("@ContactID").Value =
ContactID
Me.dadAddress.Fill(ContactInfo1.Address)

Me.dvAddress = ContactInfo1.Address.DefaultView
Me.cmbAddress.ValueMember = "AddressID"
Me.cmbAddress.DisplayMember = "AddressType"
Me.cmbAddress.DataSource = Me.dvAddress

Catch e As System.Exception
MessageBox.Show(String.Format("Error: {0}", e.Message), "LCP CRM",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub

I am clearing out the combo box and the dataview completely before clearing
and refilling the Dataset. Am I missing something?

Thanks,
Jim



"Kevin Yu [MSFT]" <v-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Jim,
>
> There is a known issue that if you bind a CombBox to a DataTable or
> DataSet, when refilling the data source, the filling process will hang.

You
> can try to set the DataSource property of the controls on the form to null
> before re-filling. And set them back after filling to see if it can

resolve
> this issue.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>




 
Reply With Quote
 
J. Clay
Guest
Posts: n/a
 
      17th Jun 2005
Note: It is on the ContactOrganizations.Clear() statment that it is
hanging.


"J. Clay" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> After doing a bunch more testing, this is what I have found.
>
> It is related to the combo box (I thought I had this dealt with). Here is
> my code:
>
> Private Sub FillContactDataSet(ByVal ContactID As Int32)
> Try
> Me.cmbAddress.DataSource = Nothing
> Me.cmbAddress.DisplayMember = Nothing
> Me.cmbAddress.ValueMember = Nothing
> Me.dvAddress = Nothing
>
> Me.ContactInfo1.Address.Clear()
> Me.ContactInfo1.ContactDetails.Clear()
> Me.ContactInfo1.ContactOrganizations.Clear()
>
>
> Me.dadContactOrganizations.SelectCommand.Parameters("@ContactID").Value =
> ContactID
> Me.dadContactOrganizations.Fill(ContactInfo1.ContactOrganizations)
>
> Me.dadContactDetails.SelectCommand.Parameters("@ContactID").Value

=
> ContactID
> Me.dadContactDetails.Fill(ContactInfo1.ContactDetails)
>
> Me.dadAddress.SelectCommand.Parameters("@ContactID").Value =
> ContactID
> Me.dadAddress.Fill(ContactInfo1.Address)
>
> Me.dvAddress = ContactInfo1.Address.DefaultView
> Me.cmbAddress.ValueMember = "AddressID"
> Me.cmbAddress.DisplayMember = "AddressType"
> Me.cmbAddress.DataSource = Me.dvAddress
>
> Catch e As System.Exception
> MessageBox.Show(String.Format("Error: {0}", e.Message), "LCP CRM",
> MessageBoxButtons.OK, MessageBoxIcon.Error)
> End Try
> End Sub
>
> I am clearing out the combo box and the dataview completely before

clearing
> and refilling the Dataset. Am I missing something?
>
> Thanks,
> Jim
>
>
>
> "Kevin Yu [MSFT]" <v-(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi Jim,
> >
> > There is a known issue that if you bind a CombBox to a DataTable or
> > DataSet, when refilling the data source, the filling process will hang.

> You
> > can try to set the DataSource property of the controls on the form to

null
> > before re-filling. And set them back after filling to see if it can

> resolve
> > this issue.
> >
> > Kevin Yu
> > =======
> > "This posting is provided "AS IS" with no warranties, and confers no
> > rights."
> >
> >

>
>
>
>




 
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
Outlook 2003 delays and stalls every 8-9 seconds =?Utf-8?B?SnVkeQ==?= Microsoft Outlook Discussion 0 27th Nov 2006 04:25 AM
IE stalls for 60+ seconds Noozer Windows XP Help 1 18th Feb 2006 08:04 PM
IE stalls for about 30 seconds =?Utf-8?B?VEppbklO?= Windows XP Internet Explorer 4 14th Jul 2005 07:23 AM
IE loads page but stalls 10-15 seconds Matt Windows XP Internet Explorer 5 9th Mar 2004 05:42 PM
Word Stalls Every Few Seconds Ian Marsh Microsoft Word New Users 1 21st Nov 2003 01:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:02 AM.