Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Ed.Poore24-Oct-06 12:08
Ed.Poore24-Oct-06 12:08 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Ed.Poore24-Oct-06 12:09
Ed.Poore24-Oct-06 12:09 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Shy Agam24-Oct-06 12:43
Shy Agam24-Oct-06 12:43 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Ed.Poore24-Oct-06 13:06
Ed.Poore24-Oct-06 13:06 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Shy Agam24-Oct-06 13:19
Shy Agam24-Oct-06 13:19 
Questionodbcdatareader hangs on close Pin
BlackDice24-Oct-06 5:19
BlackDice24-Oct-06 5:19 
AnswerRe: odbcdatareader hangs on close Pin
ednrgc24-Oct-06 6:27
ednrgc24-Oct-06 6:27 
GeneralRe: odbcdatareader hangs on close Pin
BlackDice24-Oct-06 6:47
BlackDice24-Oct-06 6:47 
No, I don't think that's it because it breaks from the loop with no problem. I put a breakpoint on the line immediately following the loop and it goes directly there with no problem. This function is being done in a thread of its own so that the user can press 'Cancel' and also updates the UI correctly.

Here's a snippet of what I'm doing:
while (statreader.Read() && !m_bCancel)
{
   stemp = statreader["aj_vchar"].ToString();
   //do other stuff here
   this.progressBar1.Increment(1);
                            
}
this.progressBar1.Value = 0;  //breakpoint here,stops here soon as I press 'Cancel'
statreader.Close(); //this line hangs for a LONG time (~10 minutes) 



I've tried calling Close() on the connection first. I've tried calling Dispose() instead, and I've tried not closing it at all to see what happens when it goes out of scope (statreader). No matter what, this reader hangs on close depening on how many records are in the reader.

When I try it on a test database that returns only a few thousand records, Close() only takes a few seconds. When I try it on a database with about 400,000 records being returned, it takes about 10 minutes for Close() to finish executing.


GeneralRe: odbcdatareader hangs on close Pin
ednrgc24-Oct-06 6:54
ednrgc24-Oct-06 6:54 
GeneralRe: odbcdatareader hangs on close Pin
BlackDice24-Oct-06 8:33
BlackDice24-Oct-06 8:33 
GeneralRe: odbcdatareader hangs on close Pin
ednrgc24-Oct-06 8:39
ednrgc24-Oct-06 8:39 
GeneralRe: odbcdatareader hangs on close Pin
BlackDice24-Oct-06 9:04
BlackDice24-Oct-06 9:04 
GeneralRe: odbcdatareader hangs on close Pin
BlackDice24-Oct-06 9:15
BlackDice24-Oct-06 9:15 
GeneralRe: odbcdatareader hangs on close Pin
BlackDice24-Oct-06 9:02
BlackDice24-Oct-06 9:02 
AnswerRe: odbcdatareader hangs on close Pin
Eric Dahlvang24-Oct-06 10:40
Eric Dahlvang24-Oct-06 10:40 
GeneralRe: odbcdatareader hangs on close Pin
BlackDice24-Oct-06 11:20
BlackDice24-Oct-06 11:20 
QuestionGridView and outer joins Pin
lsugirljte24-Oct-06 5:02
lsugirljte24-Oct-06 5:02 
QuestionRe: GridView and outer joins Pin
lsugirljte25-Oct-06 3:31
lsugirljte25-Oct-06 3:31 
QuestionSorting through a Dataset with 1 method Pin
Gareth H24-Oct-06 3:11
Gareth H24-Oct-06 3:11 
AnswerRe: Sorting through a Dataset with 1 method Pin
Not Active24-Oct-06 3:14
mentorNot Active24-Oct-06 3:14 
GeneralRe: Sorting through a Dataset with 1 method Pin
Gareth H24-Oct-06 4:30
Gareth H24-Oct-06 4:30 
GeneralRe: Sorting through a Dataset with 1 method Pin
Not Active24-Oct-06 4:51
mentorNot Active24-Oct-06 4:51 
GeneralRe: Sorting through a Dataset with 1 method Pin
Gareth H24-Oct-06 6:23
Gareth H24-Oct-06 6:23 
QuestionTo convert format of a file to other format through C# code Pin
praveen pandey24-Oct-06 3:08
praveen pandey24-Oct-06 3:08 
AnswerRe: To convert format of a file to other format through C# code Pin
Amar Chaudhary24-Oct-06 8:36
Amar Chaudhary24-Oct-06 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.