setting the CommandTimeout for a dataset?

setting the CommandTimeout for a dataset?

Postby mr breaker » Wed 20 Sep 2006 20:13

I am getting a timeout every so often when performing a long query. (VS 2005).

I have a typed Dataset and I am calling a stored procedure from a TableAdapter.


How can I set the CommandTimeout? I searched through the forum but couldn't find a way to do it.


Thanks!
mr breaker
 
Posts: 20
Joined: Thu 31 Aug 2006 18:19

Postby Alexey » Thu 21 Sep 2006 07:11

Try to set the CommandTimeout in your .Designer.cs file.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby mr breaker » Tue 03 Oct 2006 19:13

Do you have an example of this? I haven't been able to figure it out.


Thanks.
mr breaker
 
Posts: 20
Joined: Thu 31 Aug 2006 18:19

Postby mr breaker » Tue 03 Oct 2006 21:18

I think I did figure it out.


Here's the function to modify in case others run into it:

Code: Select all
  _
        Private Sub InitCommandCollection()
            Me._commandCollection = New CoreLab.MySql.MySqlCommand(0) {}
            Me._commandCollection(0) = New CoreLab.MySql.MySqlCommand
            Me._commandCollection(0).Connection = Me.Connection
            Me._commandCollection(0).CommandText = "thomas_global_reports_masters.Bot_SelectSessions"
            Me._commandCollection(0).CommandType = System.Data.CommandType.StoredProcedure
            Me._commandCollection(0).CommandTimeout = 0
        End Sub



At the top of the page it says that this file is auto-generated and changes may be lost. Is there any way to avoid that?
mr breaker
 
Posts: 20
Joined: Thu 31 Aug 2006 18:19

Postby Alexey » Wed 04 Oct 2006 07:34

Changes may be lost only if the code is regenerated.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL