Click here to Skip to main content
15,886,067 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Pin
Pete O'Hanlon4-Aug-15 3:12
mvePete O'Hanlon4-Aug-15 3:12 
AnswerRe: C# Pin
Eddy Vluggen4-Aug-15 3:18
professionalEddy Vluggen4-Aug-15 3:18 
Question#SNMP Calculate Bandwidth Utilization Pin
LeHuuTien3-Aug-15 22:07
LeHuuTien3-Aug-15 22:07 
AnswerRe: #SNMP Calculate Bandwidth Utilization Pin
Guerrilla Coder3-Aug-15 22:49
Guerrilla Coder3-Aug-15 22:49 
GeneralRe: #SNMP Calculate Bandwidth Utilization Pin
LeHuuTien4-Aug-15 2:28
LeHuuTien4-Aug-15 2:28 
Questioni am not getting my desired results Pin
Dark Commet3-Aug-15 0:18
Dark Commet3-Aug-15 0:18 
AnswerRe: i am not getting my desired results Pin
Saundarya Pradhan3-Aug-15 0:43
Saundarya Pradhan3-Aug-15 0:43 
AnswerRe: i am not getting my desired results Pin
OriginalGriff3-Aug-15 0:47
mveOriginalGriff3-Aug-15 0:47 
Dark Commet wrote:
what am i doing wrong here.


Would you like a list? Laugh | :laugh:

Being honest, the answer is "pretty much everything".
You break the two first rules of databases:
1) Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
2) Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^]

Then, you don't check to see if there are any values in your data:
VB
sda.Fill(dt);
if (dt.Rows[0][0].ToString() == "1")

Then you unnecessarily convert to string, and do string comparisons,you use default names for forms, you don't dispose of objects that hold scarce resources, you don't do any error checking, you...

You get the idea. You have a long way to go.

So follow the link, have a read of the code there, and then change your db to support hashed passwords.
Return the hashed password for the user name, and compare that instead of trying to get the count. And please - for your own sake - use parameterised queries at all times!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

AnswerRe: i am not getting my desired results Pin
Nicholas Marty3-Aug-15 0:58
professionalNicholas Marty3-Aug-15 0:58 
AnswerRe: i am not getting my desired results Pin
HUKUMAT RAY KUMAWAT3-Aug-15 18:37
HUKUMAT RAY KUMAWAT3-Aug-15 18:37 
QuestionRe: i am not getting my desired results Pin
Richard MacCutchan3-Aug-15 21:03
mveRichard MacCutchan3-Aug-15 21:03 
GeneralRe: i am not getting my desired results Pin
Eddy Vluggen3-Aug-15 21:17
professionalEddy Vluggen3-Aug-15 21:17 
GeneralRe: i am not getting my desired results Pin
Richard MacCutchan3-Aug-15 22:13
mveRichard MacCutchan3-Aug-15 22:13 
GeneralRe: i am not getting my desired results Pin
OriginalGriff3-Aug-15 22:49
mveOriginalGriff3-Aug-15 22:49 
GeneralRe: i am not getting my desired results Pin
Eddy Vluggen3-Aug-15 22:56
professionalEddy Vluggen3-Aug-15 22:56 
GeneralRe: i am not getting my desired results Pin
OriginalGriff3-Aug-15 23:11
mveOriginalGriff3-Aug-15 23:11 
GeneralRe: i am not getting my desired results Pin
Eddy Vluggen3-Aug-15 23:27
professionalEddy Vluggen3-Aug-15 23:27 
GeneralRe: i am not getting my desired results Pin
Richard MacCutchan3-Aug-15 23:49
mveRichard MacCutchan3-Aug-15 23:49 
GeneralRe: i am not getting my desired results Pin
Eddy Vluggen4-Aug-15 0:05
professionalEddy Vluggen4-Aug-15 0:05 
GeneralRe: i am not getting my desired results Pin
Richard MacCutchan4-Aug-15 0:11
mveRichard MacCutchan4-Aug-15 0:11 
GeneralRe: i am not getting my desired results Pin
Eddy Vluggen4-Aug-15 0:19
professionalEddy Vluggen4-Aug-15 0:19 
GeneralRe: i am not getting my desired results Pin
Richard MacCutchan4-Aug-15 0:27
mveRichard MacCutchan4-Aug-15 0:27 
GeneralRe: i am not getting my desired results Pin
Eddy Vluggen4-Aug-15 0:46
professionalEddy Vluggen4-Aug-15 0:46 
GeneralRe: i am not getting my desired results Pin
OriginalGriff4-Aug-15 2:36
mveOriginalGriff4-Aug-15 2:36 
GeneralRe: i am not getting my desired results Pin
Richard MacCutchan4-Aug-15 2:46
mveRichard MacCutchan4-Aug-15 2:46 

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.