Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
AnswerRe: Smart device authentification problem Pin
William Winner13-Apr-10 13:31
William Winner13-Apr-10 13:31 
GeneralRe: Smart device authentification problem Pin
Tunisien8614-Apr-10 2:32
Tunisien8614-Apr-10 2:32 
GeneralRe: Smart device authentification problem Pin
William Winner14-Apr-10 6:56
William Winner14-Apr-10 6:56 
AnswerRe: Smart device authentification problem Pin
William Winner14-Apr-10 7:12
William Winner14-Apr-10 7:12 
GeneralRe: Smart device authentification problem Pin
Tunisien8614-Apr-10 10:23
Tunisien8614-Apr-10 10:23 
GeneralRe: Smart device authentification problem Pin
William Winner14-Apr-10 10:48
William Winner14-Apr-10 10:48 
GeneralRe: Smart device authentification problem Pin
Tunisien8614-Apr-10 13:01
Tunisien8614-Apr-10 13:01 
AnswerRe: Smart device authentification problem Pin
Tunisien8619-Apr-10 23:00
Tunisien8619-Apr-10 23:00 
Hi,
Thank u a lot,I found the solution finally.This is the code
private void button1_Click(object sender, EventArgs e)
        {

            /*string req = "select Login, MotPasse from Connexion";
            DataTable tab = new DataTable();
            SqlCeCommand com = new SqlCeCommand(req, sqlceconn);
            SqlCeDataAdapter ada = new SqlCeDataAdapter(com);
            ada.Fill(tab);*/
            //Create the connection
            string wCS = @"Data Source =\Storage Card\ModeDifféré\BaseGmaoLocale.sdf;";
            SqlCeConnection sqlceconn = new SqlCeConnection(wCS);

            //Create the command
            SqlCeCommand command = sqlceconn.CreateCommand();
            command.CommandText = "Select login from Connexion where Login=@Login and MotPasse=@MotPasse ";

            //Add the parameters
            string s1=textBox1.Text; //store the login name here YOU MUST FILL THIS IN
            SqlCeParameter Login = new SqlCeParameter("@Login", SqlDbType.NVarChar);
            Login.Value = s1;

            string s2=textBox2.Text; //store the password here YOU MUST FILL THIS IN
            SqlCeParameter MotPasse = new SqlCeParameter("@MotPasse", SqlDbType.NVarChar);
            MotPasse.Value = s2;

            command.Parameters.Add(Login);
            command.Parameters.Add(MotPasse);

            //Create the adapter
            SqlCeDataAdapter adapter = new SqlCeDataAdapter(command);

            //Create and fill the dataset
            DataSet ds = new DataSet();

            try
            {
                adapter.Fill(ds, "SQL Temp Table");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            if ((ds.Tables.Count > 0) && (ds.Tables["SQL Temp Table"] != null))
            {MessageBox.Show("Number of row(s) - " + ds.Tables["SQL Temp Table"].Rows.Count);
                if(ds.Tables["SQL Temp Table"].Rows.Count>0)
                { MessageBox.Show("Authentification réussie");
                MenuP m = new MenuP();
                m.Show();}
                else MessageBox.Show("Login ou mot de passe incorrect veuillez réessayer");}
            adapter.Dispose();
            sqlceconn.Dispose();
            command.Dispose();



        }

Thanks a lot for all u contribution
QuestionWriting Assembly Attributes Programmatically Pin
Nadia Monalisa13-Apr-10 10:26
Nadia Monalisa13-Apr-10 10:26 
AnswerRe: Writing Assembly Attributes Programmatically Pin
Martin Jarvis13-Apr-10 10:32
Martin Jarvis13-Apr-10 10:32 
AnswerRe: Writing Assembly Attributes Programmatically Pin
Paw Jershauge13-Apr-10 10:41
Paw Jershauge13-Apr-10 10:41 
GeneralRe: Writing Assembly Attributes Programmatically Pin
Nadia Monalisa13-Apr-10 11:00
Nadia Monalisa13-Apr-10 11:00 
GeneralRe: Writing Assembly Attributes Programmatically Pin
PIEBALDconsult13-Apr-10 11:17
mvePIEBALDconsult13-Apr-10 11:17 
GeneralRe: Writing Assembly Attributes Programmatically Pin
Nadia Monalisa13-Apr-10 11:46
Nadia Monalisa13-Apr-10 11:46 
GeneralRe: Writing Assembly Attributes Programmatically Pin
Luc Pattyn13-Apr-10 13:16
sitebuilderLuc Pattyn13-Apr-10 13:16 
GeneralRe: Writing Assembly Attributes Programmatically Pin
PIEBALDconsult13-Apr-10 13:36
mvePIEBALDconsult13-Apr-10 13:36 
GeneralRe: Writing Assembly Attributes Programmatically Pin
Luc Pattyn13-Apr-10 13:41
sitebuilderLuc Pattyn13-Apr-10 13:41 
GeneralRe: Writing Assembly Attributes Programmatically Pin
PIEBALDconsult13-Apr-10 13:47
mvePIEBALDconsult13-Apr-10 13:47 
QuestionPrint images with the correct size Pin
Eagle3213-Apr-10 9:33
Eagle3213-Apr-10 9:33 
AnswerRe: Print images with the correct size Pin
Alan Balkany14-Apr-10 3:57
Alan Balkany14-Apr-10 3:57 
GeneralRe: Print images with the correct size Pin
Eagle3214-Apr-10 11:55
Eagle3214-Apr-10 11:55 
GeneralRe: Print images with the correct size Pin
Alan Balkany15-Apr-10 2:56
Alan Balkany15-Apr-10 2:56 
QuestionRunning a BackgroundWorker in a Single Threaded Apartment Pin
William Winner13-Apr-10 9:09
William Winner13-Apr-10 9:09 
AnswerRe: Running a BackgroundWorker in a Single Threaded Apartment Pin
Luc Pattyn13-Apr-10 11:08
sitebuilderLuc Pattyn13-Apr-10 11:08 
GeneralRe: Running a BackgroundWorker in a Single Threaded Apartment Pin
William Winner13-Apr-10 11:21
William Winner13-Apr-10 11:21 

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.