Click here to Skip to main content
15,505,380 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming22-Mar-22 0:25
mveRichard Deeming22-Mar-22 0:25 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:34
N Mohamed rafi22-Mar-22 0:34 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming22-Mar-22 0:45
mveRichard Deeming22-Mar-22 0:45 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:37
N Mohamed rafi22-Mar-22 0:37 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming22-Mar-22 0:44
mveRichard Deeming22-Mar-22 0:44 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:47
N Mohamed rafi22-Mar-22 0:47 
RantRe: C# to Mysql Login code Error Pin
Richard Deeming22-Mar-22 1:03
mveRichard Deeming22-Mar-22 1:03 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 1:47
mveRichard MacCutchan22-Mar-22 1:47 
How many times do I need to say it: Do not post a success message when you have not checked the result of your Database query.
This is the way you should do it:
C++
cnn.Open();
int result = cmd.ExecuteNonQuery(); // always capture the result
cnn.Close();
if (result == 1)
{
    MessageBox.Show("Login was successful");
}
else
{
    MessageBox.Show("The entered details were not correct");
}

Also, why do you need two ids (userid and loginid)? You should only need a single id and a password.
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 1:49
N Mohamed rafi22-Mar-22 1:49 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 1:51
N Mohamed rafi22-Mar-22 1:51 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 1:54
N Mohamed rafi22-Mar-22 1:54 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 1:57
mveRichard MacCutchan22-Mar-22 1:57 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 2:06
N Mohamed rafi22-Mar-22 2:06 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 2:09
mveRichard MacCutchan22-Mar-22 2:09 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 2:24
N Mohamed rafi22-Mar-22 2:24 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 2:28
mveRichard MacCutchan22-Mar-22 2:28 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 2:37
N Mohamed rafi22-Mar-22 2:37 
GeneralRe: C# to Mysql Login code Error Pin
Dave Kreskowiak22-Mar-22 3:57
mveDave Kreskowiak22-Mar-22 3:57 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan21-Mar-22 23:46
mveRichard MacCutchan21-Mar-22 23:46 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 23:49
N Mohamed rafi21-Mar-22 23:49 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 0:10
mveRichard MacCutchan22-Mar-22 0:10 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:26
N Mohamed rafi22-Mar-22 0:26 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 0:42
mveRichard MacCutchan22-Mar-22 0:42 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 0:49
N Mohamed rafi22-Mar-22 0:49 
GeneralRe: C# to Mysql Login code Error Pin
Richard MacCutchan22-Mar-22 0:55
mveRichard MacCutchan22-Mar-22 0:55 

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.