C#:checking existing record in database Mysql
- by Meko
HI.I searched this question inform and I found solution to change column property Unique Index.Now If I try to insert same record cmd.ExecuteNonQuery() gives error that record exist ,but how can use this exception to give user a message that record exist and must enter new one ? I am trying to make some thing like
if(cmd.ExecuteNonQuery() !=true )
{
MessageBox.Show("User Exists");
}
But I dont know what returns cmd.ExecuteNonQuery() ?
Or I must get records using reader in table and compare them with text in Textfiel?