thank u mkgoud friend.
now my program is correctly working.
Pls Check my Code,. And Give the Feedback,. whether it is a effective code or not?.
private void button1_Click(object sender, RoutedEventArgs e)
{
# region Command Method
string MyConString = "SERVER=192.168.1.100;" + "DATABASE=mcs_kiosk;" + "UID=root;" + "PASSWORD=;";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select * from mcs_User";
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
if ((textBox1.Text == Reader[1].ToString()) && (passwordBox1.Password== Reader[2].ToString()))
{
Master mas = new Master();
mas.Show();
}
else
MessageBox.Show("Password or Username not Correct");
}
connection.Close();
#endregion
}