Click here to Skip to main content
16,005,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: game dev doubt Pin
Christian Graus4-Feb-09 20:27
protectorChristian Graus4-Feb-09 20:27 
GeneralRe: game dev doubt Pin
Sai Yasodharan4-Feb-09 20:46
Sai Yasodharan4-Feb-09 20:46 
GeneralRe: game dev doubt Pin
Christian Graus4-Feb-09 22:46
protectorChristian Graus4-Feb-09 22:46 
GeneralRe: game dev doubt Pin
Sai Yasodharan4-Feb-09 23:08
Sai Yasodharan4-Feb-09 23:08 
AnswerRe: game dev doubt Pin
musefan4-Feb-09 22:41
musefan4-Feb-09 22:41 
GeneralRe: game dev doubt Pin
Sai Yasodharan4-Feb-09 23:09
Sai Yasodharan4-Feb-09 23:09 
AnswerRe: game dev doubt Pin
benjymous5-Feb-09 0:34
benjymous5-Feb-09 0:34 
Questionlogin code is not working Pin
ashish1nov20084-Feb-09 20:22
ashish1nov20084-Feb-09 20:22 
Hi expert ,

this is login code with Mysql Connectivity .it is not working.
no error is showing


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace ExampleOne
{
    public partial class login : Form
    {

        public login()
        {
            
            
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnlogin_Click(object sender, EventArgs e)
        {
            string g_login = this.tbUsername.Text;
            string g_password = this.tbpassword.Text;
            string MyConString = "server=localhost;database=password;uid=root;password=asd";
            MySqlConnection connection = new MySqlConnection(MyConString);
            string Strsql = "select * from tablogin where userid = ' " + g_login + " 'AND password=' " + g_password + " ' ";
            MySqlCommand command = new MySqlCommand(Strsql, connection);
            MySqlDataReader Reader;
           try
            {
                connection.Open();
                Reader = command.ExecuteReader();
                while (Reader.Read())
                {
                    string auser;
                    string apwd;

                    auser = (Reader[g_login].ToString());
                    apwd = (Reader[g_password].ToString());


                    if (auser == g_login && apwd == g_password)
                    {
                        MessageBox.Show("INCORRECT USER/PASS!");
                    }
                    else
                    {
                        MessageBox.Show("YOU ARE LOGGED IN!");
                    }
                }
                connection.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error Conecting to database", "window information" + ex.Message.ToString(),
                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
    }
}

AnswerRe: login code is not working Pin
Christian Graus4-Feb-09 20:37
protectorChristian Graus4-Feb-09 20:37 
AnswerRe: login code is not working Pin
Vimalsoft(Pty) Ltd4-Feb-09 21:28
professionalVimalsoft(Pty) Ltd4-Feb-09 21:28 
QuestionHttpWebResponse's GetResponse() hangs.. Pin
bigeyed4-Feb-09 20:07
bigeyed4-Feb-09 20:07 
AnswerRe: HttpWebResponse's GetResponse() hangs.. Pin
Rob Philpott4-Feb-09 21:38
Rob Philpott4-Feb-09 21:38 
GeneralRe: HttpWebResponse's GetResponse() hangs.. Pin
bigeyed4-Feb-09 21:48
bigeyed4-Feb-09 21:48 
GeneralRe: HttpWebResponse's GetResponse() hangs.. Pin
Rob Philpott4-Feb-09 21:59
Rob Philpott4-Feb-09 21:59 
GeneralRe: HttpWebResponse's GetResponse() hangs.. Pin
bigeyed5-Feb-09 1:29
bigeyed5-Feb-09 1:29 
GeneralRe: HttpWebResponse's GetResponse() hangs.. Pin
Rob Philpott5-Feb-09 1:54
Rob Philpott5-Feb-09 1:54 
GeneralRe: HttpWebResponse's GetResponse() hangs.. Pin
Rob Philpott5-Feb-09 2:00
Rob Philpott5-Feb-09 2:00 
QuestionHelp C -> C# (FSC-16 Table Generator) Pin
TaeGyu Kang4-Feb-09 20:05
TaeGyu Kang4-Feb-09 20:05 
AnswerRe: Help C -> C# (FSC-16 Table Generator) Pin
Christian Graus4-Feb-09 20:38
protectorChristian Graus4-Feb-09 20:38 
AnswerRe: Help C -> C# (FSC-16 Table Generator) Pin
Dave Doknjas5-Feb-09 14:08
Dave Doknjas5-Feb-09 14:08 
GeneralRe: Help C -> C# (FSC-16 Table Generator) Pin
Dave Doknjas5-Feb-09 14:15
Dave Doknjas5-Feb-09 14:15 
QuestionLog analyzer Pin
CodingLover4-Feb-09 19:59
CodingLover4-Feb-09 19:59 
AnswerRe: Log analyzer Pin
SeMartens4-Feb-09 21:16
SeMartens4-Feb-09 21:16 
NewsRe: Log analyzer Pin
CodingLover4-Feb-09 21:37
CodingLover4-Feb-09 21:37 
GeneralRe: Log analyzer Pin
SeMartens4-Feb-09 22:12
SeMartens4-Feb-09 22:12 

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.