Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
AnswerRe: Adobe Acrobat PDF link cann't work on windows form Pin
Vasudevan Deepak Kumar10-Jul-09 2:57
Vasudevan Deepak Kumar10-Jul-09 2:57 
Questionadobe acrobat pdf link cann't work on windows form Pin
Bhim Prakash Singh9-Jul-09 22:47
Bhim Prakash Singh9-Jul-09 22:47 
AnswerRe: adobe acrobat pdf link cann't work on windows form Pin
Manas Bhardwaj9-Jul-09 22:52
professionalManas Bhardwaj9-Jul-09 22:52 
QuestionVersion in VS2005 or VS2008 Pin
stancrm9-Jul-09 22:39
stancrm9-Jul-09 22:39 
AnswerRe: Version in VS2005 or VS2008 Pin
Manas Bhardwaj9-Jul-09 22:50
professionalManas Bhardwaj9-Jul-09 22:50 
QuestionI'm trying to build a TaskBar similar application, how to enum running applications? (Advanced Q) Pin
leeoze9-Jul-09 22:09
leeoze9-Jul-09 22:09 
Questionneed help Pin
mjawadkhatri9-Jul-09 21:12
mjawadkhatri9-Jul-09 21:12 
AnswerRe: need help Pin
SeMartens9-Jul-09 21:29
SeMartens9-Jul-09 21:29 
Hi,

it seems that you want to check if a user exists or not.

I would seperate the presentation (your dialog) from the dataaccess (the select). Try to implement it like this:

private bool DoesUserExists(string sUserID) {
  ... perform a select statement here with a prepared statement
  ... then check if you have exactly one record
  bool bResult = odr.Read(); --> true if you have one record
  ... close everything
  return b;
}

public void CheckUser() {
    ... get the value from your textbox
    // call method to check if user exists
    if(this.DoesUserExists(sUserID)) {
       // show success dialog
    } else {
       // show failure dialog
    }
}


That would be a better approach than yours. By the way, it doesn't make any sense to check the userid in your database within the code, use the WHERE-clause of SELECT-statements for this.

Hope this helps a bit.

Regards
Sebastian

It's not a bug, it's a feature!

Check out my CodeProject article Permission-by-aspect.

Me in Softwareland.

GeneralRe: need help Pin
mjawadkhatri9-Jul-09 21:42
mjawadkhatri9-Jul-09 21:42 
GeneralRe: need help Pin
SeMartens9-Jul-09 21:53
SeMartens9-Jul-09 21:53 
GeneralRe: need help Pin
mjawadkhatri10-Jul-09 0:17
mjawadkhatri10-Jul-09 0:17 
GeneralRe: need help Pin
SeMartens10-Jul-09 0:29
SeMartens10-Jul-09 0:29 
GeneralRe: need help Pin
mjawadkhatri10-Jul-09 0:40
mjawadkhatri10-Jul-09 0:40 
GeneralRe: need help Pin
SeMartens10-Jul-09 0:45
SeMartens10-Jul-09 0:45 
GeneralRe: need help Pin
mjawadkhatri10-Jul-09 0:50
mjawadkhatri10-Jul-09 0:50 
GeneralRe: need help Pin
N a v a n e e t h9-Jul-09 21:46
N a v a n e e t h9-Jul-09 21:46 
JokeRe: need help Pin
SeMartens9-Jul-09 21:55
SeMartens9-Jul-09 21:55 
GeneralRe: need help Pin
mjawadkhatri10-Jul-09 0:29
mjawadkhatri10-Jul-09 0:29 
AnswerRe: need help Pin
K03069-Jul-09 21:39
K03069-Jul-09 21:39 
Answer== and .Equals() are different. Pin
Nagy Vilmos9-Jul-09 22:19
professionalNagy Vilmos9-Jul-09 22:19 
QuestionHow can I encrypt to message in WCF? Pin
dataminers9-Jul-09 20:40
dataminers9-Jul-09 20:40 
AnswerRe: How can I encrypt to message in WCF? Pin
SeMartens9-Jul-09 21:09
SeMartens9-Jul-09 21:09 
AnswerRe: How can I encrypt to message in WCF? Pin
SeMartens9-Jul-09 21:10
SeMartens9-Jul-09 21:10 
QuestionModified TextBox property not persisting in designer Pin
SillyPants9-Jul-09 19:51
SillyPants9-Jul-09 19:51 
AnswerRe: Modified TextBox property not persisting in designer Pin
DaveyM699-Jul-09 22:39
professionalDaveyM699-Jul-09 22:39 

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.