string s1 = textBox1.Text.ToString();
string s2 = textBox2.Text.ToString();
Text property is already a string, so you don't need the ToString() method here. So :
string s1 = textBox1.Text;
string s2 = textBox2.Text;
is sufficient.
SqlCeConnection cnx = new SqlCeConnection("..."); // Replace ... by the right connexion string
string req = "SELECT * FROM Connexion WHERE Login = @login AND MotPasse = @pass";
SqlCeCommand cmd = new SqlCeCommand(req, cnx);
SqlCeParameter login = new SqlCeParameter("login", s1);
cmd.Parameters.Add(login);
SqlCeParameter pass = new SqlCeParameter("pass", s2);
cmd.Parameters.Add(pass);
...
Here's the general idea. Hope it'll be useful.
modified on Tuesday, April 13, 2010 10:54 AM