Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing different variable types Pin
mprice21413-Apr-10 6:32
mprice21413-Apr-10 6:32 
QuestionHow to Save the Excel file with some file format [modified] [Solved] Pin
yu-jian13-Apr-10 4:37
yu-jian13-Apr-10 4:37 
AnswerRe: How to Save the Excel file with some file format Pin
Dan Mos13-Apr-10 5:13
Dan Mos13-Apr-10 5:13 
Questiondatagrid checkbox Pin
Morgs Morgan13-Apr-10 4:26
Morgs Morgan13-Apr-10 4:26 
AnswerRe: datagrid checkbox Pin
J imran13-Apr-10 8:16
J imran13-Apr-10 8:16 
GeneralRe: datagrid checkbox Pin
Morgs Morgan13-Apr-10 9:33
Morgs Morgan13-Apr-10 9:33 
Questionsmart device Forms-Database Pin
Tunisien8613-Apr-10 2:18
Tunisien8613-Apr-10 2:18 
AnswerRe: smart device Forms-Database Pin
Luc Pattyn13-Apr-10 2:55
sitebuilderLuc Pattyn13-Apr-10 2:55 
Hi,

several comments:
1.
your database does not know what s1 and s2 mean in Select("Login like s1 and MotPasse like s2");
you want the content of s1 and s2, not the names of the variables; so they must not be inside double quotes.
and then you want SQL to see them as string literals, which requires single quotes.
So at least you should change it to
...Select("Login like '"+s1+"' and MotPasse like '"+s2+"'");


2.
it does not make sense to use like like that, there are no wildcards, nor anything special. So better write
...Select("Login = '"+s1+"' and MotPasse = '"+s2+"'");


3.
you should not pass user input straight to an SQL statement, it makes your app very vulnerable; the user could type things that end up your SQL statement do things you don't want such as delete a table.
Either check your inputs (you must avoid empty fields too!) or use parameterized SQL (use SQLParameter).

4.
You should not store plain passwords in a database; you should use encryption or hashing. Read up on best practices for passwords!

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.


AnswerRe: smart device Forms-Database [modified] Pin
Tim Yen13-Apr-10 2:55
Tim Yen13-Apr-10 2:55 
GeneralRe: smart device Forms-Database Pin
Luc Pattyn13-Apr-10 3:11
sitebuilderLuc Pattyn13-Apr-10 3:11 
GeneralRe: smart device Forms-Database Pin
Tunisien8613-Apr-10 4:17
Tunisien8613-Apr-10 4:17 
AnswerRe: smart device Forms-Database [modified] Pin
O.Phil13-Apr-10 4:11
O.Phil13-Apr-10 4:11 
GeneralRe: smart device Forms-Database Pin
Luc Pattyn13-Apr-10 4:20
sitebuilderLuc Pattyn13-Apr-10 4:20 
GeneralRe: smart device Forms-Database Pin
O.Phil13-Apr-10 4:26
O.Phil13-Apr-10 4:26 
GeneralRe: smart device Forms-Database Pin
Luc Pattyn13-Apr-10 4:29
sitebuilderLuc Pattyn13-Apr-10 4:29 
GeneralRe: smart device Forms-Database Pin
Tunisien8613-Apr-10 6:01
Tunisien8613-Apr-10 6:01 
GeneralRe: smart device Forms-Database Pin
O.Phil13-Apr-10 22:45
O.Phil13-Apr-10 22:45 
QuestionIDENT_CURRENT Pin
devvvy12-Apr-10 22:47
devvvy12-Apr-10 22:47 
AnswerRe: IDENT_CURRENT Pin
Pete O'Hanlon12-Apr-10 23:01
mvePete O'Hanlon12-Apr-10 23:01 
AnswerRe: IDENT_CURRENT Pin
Tim Yen13-Apr-10 3:04
Tim Yen13-Apr-10 3:04 
AnswerRe: IDENT_CURRENT Pin
PIEBALDconsult13-Apr-10 4:09
mvePIEBALDconsult13-Apr-10 4:09 
QuestionShow image on upload [modified] Pin
DX Roster12-Apr-10 21:53
DX Roster12-Apr-10 21:53 
AnswerRe: Show image on upload Pin
Gaurav Dudeja India13-Apr-10 1:23
Gaurav Dudeja India13-Apr-10 1:23 
GeneralRe: Show image on upload Pin
DX Roster13-Apr-10 4:21
DX Roster13-Apr-10 4:21 
QuestionODBC Connection Problem Pin
mjawadkhatri12-Apr-10 21:08
mjawadkhatri12-Apr-10 21:08 

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.