Click here to Skip to main content
15,918,742 members
Home / Discussions / C#
   

C#

 
GeneralRe: Disable the designer Pin
PIEBALDconsult12-Oct-07 17:48
mvePIEBALDconsult12-Oct-07 17:48 
GeneralRe: Disable the designer Pin
Daniel Grunwald13-Oct-07 0:02
Daniel Grunwald13-Oct-07 0:02 
Question.Net remoting's Http Channel. Pin
dhami_naresh12-Oct-07 8:34
dhami_naresh12-Oct-07 8:34 
AnswerRe: .Net remoting's Http Channel. Pin
led mike12-Oct-07 9:45
led mike12-Oct-07 9:45 
GeneralRe: .Net remoting's Http Channel. Pin
dhami_naresh12-Oct-07 21:58
dhami_naresh12-Oct-07 21:58 
GeneralRe: .Net remoting's Http Channel. Pin
led mike13-Oct-07 5:35
led mike13-Oct-07 5:35 
GeneralRe: .Net remoting's Http Channel. Pin
dhami_naresh13-Oct-07 7:43
dhami_naresh13-Oct-07 7:43 
QuestionLogon form problem Pin
MumbleB12-Oct-07 7:38
MumbleB12-Oct-07 7:38 
Hi Guys,

I have added a basic logon form that gets a users logon name and password and matches that to a given list to my project. Once it has been validated it calls the main form. Now, Cry | :(( the problem I have is that when it calls the main form I can't connect to the db. The user validation is done in the logon form class as you can see below.

private void button1_Click(object sender, EventArgs e)
{
    frmNef frm1 = new frmNef();
    if (textBox1.Text == "maphanga" && textBox2.Text == "marsha" || textBox1.Text == "nkosi" && textBox2.Text == "mdu" || textBox1.Text == "carrim" && textBox2.Text == "allerece" || textBox1.Text == "raphela" && textBox2.Text == "rachel" || textBox1.Text == "mazibuko" && textBox2.Text == "zoliswa")
    {
        this.DialogResult = DialogResult.OK;
        //this.DialogResult = DialogResult.OK;
    }



    else MessageBox.Show("Invalid Username and or Password supplied");



}


This is then validated in the main form's load event.

private void frmNef_Load(object sender, EventArgs e)
{

    Login login = new Login();
    if (login.ShowDialog(this) == DialogResult.OK)
    {
        return;
    }
    else this.Close();
    login.Close();
    login.Dispose();


Can somebody please tell me how I can do this better so as to get the connection to the DB working properly with the logon form? I had to remove the logon form before the app would work again.

Thanking you in advance.
AnswerRe: Logon form problem Pin
led mike12-Oct-07 9:49
led mike12-Oct-07 9:49 
GeneralRe: Logon form problem Pin
MumbleB12-Oct-07 10:46
MumbleB12-Oct-07 10:46 
GeneralRe: Logon form problem Pin
led mike12-Oct-07 10:52
led mike12-Oct-07 10:52 
GeneralRe: Logon form problem Pin
MumbleB12-Oct-07 11:05
MumbleB12-Oct-07 11:05 
GeneralRe: Logon form problem Pin
Paul Conrad12-Oct-07 11:59
professionalPaul Conrad12-Oct-07 11:59 
GeneralRe: Logon form problem Pin
MumbleB12-Oct-07 20:31
MumbleB12-Oct-07 20:31 
GeneralRe: Logon form problem Pin
MumbleB12-Oct-07 21:02
MumbleB12-Oct-07 21:02 
GeneralRe: Logon form problem Pin
Paul Conrad13-Oct-07 4:48
professionalPaul Conrad13-Oct-07 4:48 
QuestionCapture how many times a page has been called Pin
d546412-Oct-07 7:14
d546412-Oct-07 7:14 
AnswerRe: Capture how many times a page has been called Pin
led mike12-Oct-07 7:26
led mike12-Oct-07 7:26 
GeneralRe: Capture how many times a page has been called Pin
d546413-Oct-07 15:43
d546413-Oct-07 15:43 
QuestionMovement... sigh Pin
MasterSharp12-Oct-07 6:52
MasterSharp12-Oct-07 6:52 
AnswerRe: Movement... sigh Pin
Luc Pattyn12-Oct-07 7:05
sitebuilderLuc Pattyn12-Oct-07 7:05 
GeneralRe: Movement... sigh Pin
MasterSharp12-Oct-07 7:08
MasterSharp12-Oct-07 7:08 
GeneralRe: Movement... sigh Pin
led mike12-Oct-07 7:20
led mike12-Oct-07 7:20 
GeneralRe: Movement... sigh Pin
Luc Pattyn12-Oct-07 7:23
sitebuilderLuc Pattyn12-Oct-07 7:23 
GeneralRe: Movement... sigh Pin
MasterSharp12-Oct-07 16:39
MasterSharp12-Oct-07 16: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.