Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can somebody elaborate for me to the below MySQL commands under the

MySql
BeginExecuteNonQuery()

and
MySql
ExecuteNonQuery()


1. why we use this for execute the query?
2. What is the difference of both either using one?
3. is there any performance optimizing issues?

What I have tried:

MySql
 Con.Open();
string q3 = "DELETE FROM producttbl WHERE productid='" + this.textBox1.Text + "';";
MySqlCommand cmd = new MySqlCommand(q3, Con);
cmd.ExecuteNonQuery(); // cant we use cmd.BeginExecuteNonQuery();
                    MessageBox.Show("Product Deleted");
                    Con.Close();
Posted
Updated 28-Oct-22 22:30pm

 
Share this answer
 
To add to what Richard has said, see here: MySQL :: X DevAPI User Guide :: 3.3 Synchronous versus Asynchronous Execution[^] for info on why you might use asynchronous access methods.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900