Click here to Skip to main content
15,792,510 members
Home / Discussions / C#
   

C#

 
GeneralRe: how sort datgridview or listview like windows explorer Pin
Le@rner22-Mar-22 2:20
Le@rner22-Mar-22 2:20 
GeneralRe: how sort datgridview or listview like windows explorer Pin
Dave Kreskowiak22-Mar-22 2:50
mveDave Kreskowiak22-Mar-22 2:50 
AnswerRe: how sort datgridview or listview like windows explorer Pin
Richard Deeming21-Mar-22 23:32
mveRichard Deeming21-Mar-22 23:32 
GeneralRe: how sort datgridview or listview like windows explorer Pin
Le@rner22-Mar-22 3:00
Le@rner22-Mar-22 3:00 
GeneralRe: how sort datgridview or listview like windows explorer Pin
Le@rner28-Mar-22 2:36
Le@rner28-Mar-22 2:36 
GeneralRe: how sort datgridview or listview like windows explorer Pin
Richard Deeming28-Mar-22 22:45
mveRichard Deeming28-Mar-22 22:45 
AnswerRe: how sort datgridview or listview like windows explorer Pin
RobertSF26-Mar-22 14:32
professionalRobertSF26-Mar-22 14:32 
GeneralC# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 17:34
N Mohamed rafi21-Mar-22 17:34 
Sir, I have studied and tried to put login page but it shows code error please tell me the correction sir
It shows error: System.InvalidOperationException: 'The connection is already and also code error
private void button14_Click(object sender, EventArgs e)
{
if (textBox9.Text != "" && textBox10.Text != "")
{
string connectionString;
MySqlConnection cnn;
connectionString = @"Data Source=localhost;Initial Catalog=testDB;User ID=root;Password=mysql";
cnn = new MySqlConnection(connectionString);
cnn.Open();
string id = textBox9.Text;
string password = textBox10.Text;
textBox9.Text = "";
textBox10.Text = "";
string query = "select * from login where userid=@userid,password=@password,confirmpassword=@confirmpassword where loginid=@loginid is same";
//string query = "update employee set employee_name=@employee_name,employee_salary=@employee_salary where employee_id=@employee_id";
using (MySqlCommand cmd = new MySqlCommand(query))
{
cmd.Parameters.AddWithValue("@userid", id);
//cmd.Parameters.AddWithValue("@employee_id", Convert.ToInt32(id));
cmd.Parameters.AddWithValue("@password", password);
//cmd.Parameters.AddWithValue("@confirmpassword", confirmpassword);
cmd.Connection = cnn;
cnn.Open();
cmd.ExecuteNonQuery();
DialogResult dr = MessageBox.Show("Are you sure to Login now?", "Confirmation", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
MessageBox.Show("Login Successfully");
cnn.Close();
this.Hide();
Form2 f2 = new Form2();
f2.ShowDialog();
}
else if (dr == DialogResult.No)
{
MessageBox.Show("Please Enter Correct Login details");
}
}
}
else
{
MessageBox.Show("Please Enter details to Login");
}
}
}
SuggestionRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 23:26
mveRichard Deeming21-Mar-22 23:26 
AnswerRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 23:28
mveRichard Deeming21-Mar-22 23:28 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 23:33
N Mohamed rafi21-Mar-22 23:33 
GeneralRe: C# to Mysql Login code Error Pin
Richard Deeming21-Mar-22 23:38
mveRichard Deeming21-Mar-22 23:38 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi21-Mar-22 23:43
N Mohamed rafi21-Mar-22 23:43 
GeneralRe: 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
N Mohamed rafi22-Mar-22 0:20
N Mohamed rafi22-Mar-22 0:20 
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 
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 

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.