Click here to Skip to main content
15,347,815 members
Home / Discussions / C#
   

C#

 
AnswerRe: how sort datgridview or listview like windows explorer Pin
RobertSF26-Mar-22 13:32
professionalRobertSF26-Mar-22 13:32 
GeneralC# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 16:34
MemberN Mohamed rafi21-Mar-22 16:34 
SuggestionRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 22:26
mveRichard Deeming21-Mar-22 22:26 
AnswerRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 22:28
mveRichard Deeming21-Mar-22 22:28 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 22:33
MemberN Mohamed rafi21-Mar-22 22:33 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 22:38
mveRichard Deeming21-Mar-22 22:38 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 22:43
MemberN Mohamed rafi21-Mar-22 22:43 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 23:03
mveRichard Deeming21-Mar-22 23:03 
Look at your query:
Quote:
SQL
select * from login where userid=@userid, password=@password, confirmpassword=@confirmpassword where loginid=@loginid is same
You have two where clauses, which is not valid. And as far as I can see, that is same on the end is also not valid. And putting a comma between conditions is also not valid - you need to use AND instead.

Aside from that, you have four parameters: @userid, @password, @confirmpassword, and @loginid.

Now look at the parameters you are passing to the command:
Quote:
C#
cmd.Parameters.AddWithValue("@userid", id);
//cmd.Parameters.AddWithValue("@employee_id", Convert.ToInt32(id));
cmd.Parameters.AddWithValue("@password", password);
//cmd.Parameters.AddWithValue("@confirmpassword", confirmpassword);
You are passing TWO parameters: @userid and @password.

Either fix you query to use the parameters you are passing, or fix your code to pass the parameters required by the query.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 23:20
MemberN Mohamed rafi21-Mar-22 23:20 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 23:25
mveRichard Deeming21-Mar-22 23:25 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 23:34
MemberN Mohamed rafi21-Mar-22 23:34 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 23:45
mveRichard Deeming21-Mar-22 23:45 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 23:37
MemberN Mohamed rafi21-Mar-22 23:37 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 23:44
mveRichard Deeming21-Mar-22 23:44 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 23:47
MemberN Mohamed rafi21-Mar-22 23:47 
RantRe: C# to Mysql Login code Error Pin
Richard Deeming22-Mar-22 0:03
mveRichard Deeming22-Mar-22 0:03 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 0:47
mveRichard MacCutchan22-Mar-22 0:47 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:49
MemberN Mohamed rafi22-Mar-22 0:49 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:51
MemberN Mohamed rafi22-Mar-22 0:51 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:54
MemberN Mohamed rafi22-Mar-22 0:54 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 0:57
mveRichard MacCutchan22-Mar-22 0:57 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 1:06
MemberN Mohamed rafi22-Mar-22 1:06 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 1:09
mveRichard MacCutchan22-Mar-22 1:09 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 1:24
MemberN Mohamed rafi22-Mar-22 1:24 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 1:28
mveRichard MacCutchan22-Mar-22 1:28 

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.