Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: Transferring focus from a textbox to a button [Modified] Pin
Rod Kemp24-Jan-10 3:34
Rod Kemp24-Jan-10 3:34 
AnswerRe: Transferring focus from a textbox to a button Pin
Jimmanuel24-Jan-10 3:16
Jimmanuel24-Jan-10 3:16 
GeneralRe: Transferring focus from a textbox to a button Pin
gamer112724-Jan-10 3:53
gamer112724-Jan-10 3:53 
GeneralRe: Transferring focus from a textbox to a button Pin
Jimmanuel24-Jan-10 4:23
Jimmanuel24-Jan-10 4:23 
GeneralRe: Transferring focus from a textbox to a button Pin
gamer112724-Jan-10 4:34
gamer112724-Jan-10 4:34 
GeneralRe: Transferring focus from a textbox to a button Pin
gamer112724-Jan-10 4:14
gamer112724-Jan-10 4:14 
AnswerRe: Transferring focus from a textbox to a button Pin
gamer112724-Jan-10 4:18
gamer112724-Jan-10 4:18 
GeneralRe: Transferring focus from a textbox to a button Pin
Jimmanuel24-Jan-10 4:38
Jimmanuel24-Jan-10 4:38 
There are a couple things wrong:
* This deserves a new post instead of a reply to your original question.
* The reader and connection are not properly disposed of, they should be used in using statements to ensure that even if the Exception handler or this.Close() is called they get cleaned up properly.
* Catching the general Exception is considered bad practice.
* The case where dbReader.Read() returns false isn't handled - if there aren't any matching rows then the inner if - else will be skipped completely *** This is probably the cause of what you're seeing
* SELECT * is also not the best practice, it'd be better if you specify the column names in the SELECT.
* You should use a parameterized query to prevent SQL injection attacks. Here's and example for SqlConnections: clickety[^], OleDbConnections are similar
* shouldn't that while be an if?
* If those column values might be null then they should be checked for DBNull.Value before they're ToString()ed

Badger | [badger,badger,badger,badger...]

GeneralRe: Transferring focus from a textbox to a button Pin
gamer112724-Jan-10 5:18
gamer112724-Jan-10 5:18 
GeneralRe: Transferring focus from a textbox to a button Pin
Jimmanuel24-Jan-10 5:32
Jimmanuel24-Jan-10 5:32 
GeneralRe: Transferring focus from a textbox to a button Pin
gamer112724-Jan-10 5:53
gamer112724-Jan-10 5:53 
GeneralRe: Transferring focus from a textbox to a button Pin
Jimmanuel24-Jan-10 5:58
Jimmanuel24-Jan-10 5:58 
GeneralRe: Transferring focus from a textbox to a button Pin
ragnaroknrol25-Jan-10 2:36
ragnaroknrol25-Jan-10 2:36 
QuestionMy Options Window Pin
Jassim Rahma24-Jan-10 1:50
Jassim Rahma24-Jan-10 1:50 
AnswerRe: My Options Window Pin
Som Shekhar24-Jan-10 2:22
Som Shekhar24-Jan-10 2:22 
QuestionPassing and displaying variables in forms Pin
Wogboiii23-Jan-10 23:36
Wogboiii23-Jan-10 23:36 
AnswerRe: Passing and displaying variables in forms Pin
Som Shekhar23-Jan-10 23:51
Som Shekhar23-Jan-10 23:51 
GeneralRe: Passing and displaying variables in forms Pin
Wogboiii24-Jan-10 0:01
Wogboiii24-Jan-10 0:01 
GeneralRe: Passing and displaying variables in forms Pin
Som Shekhar24-Jan-10 0:05
Som Shekhar24-Jan-10 0:05 
GeneralRe: Passing and displaying variables in forms Pin
Wogboiii24-Jan-10 0:09
Wogboiii24-Jan-10 0:09 
GeneralRe: Passing and displaying variables in forms Pin
Som Shekhar24-Jan-10 0:14
Som Shekhar24-Jan-10 0:14 
GeneralRe: Passing and displaying variables in forms Pin
Wogboiii24-Jan-10 17:21
Wogboiii24-Jan-10 17:21 
GeneralRe: Passing and displaying variables in forms Pin
Som Shekhar24-Jan-10 17:47
Som Shekhar24-Jan-10 17:47 
AnswerRe: Passing and displaying variables in forms Pin
sanforjackass24-Jan-10 0:15
sanforjackass24-Jan-10 0:15 
AnswerRe: Passing and displaying variables in forms Pin
#realJSOP24-Jan-10 2:05
mve#realJSOP24-Jan-10 2:05 

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.