Conteúdo do Curso
Introduction to .NET with C#
Introduction to .NET with C#
MySqlCommand Methods
Note
If you're unable to delete objects from the MySQL server, it is possible that the server is running in safe mode. To disable safe mode, you can run the following query:
SET SQL_SAFE_UPDATES=0;
.
Important Points
- We use
ExecuteNonQuery
for commands which modify the database; ExecuteReader
andExecuteScalar
are for querying commands that retrieve data from the database;ExecuteReader
returns aMySqlDataReader
object;MySqlDataReader
has a method calledread()
which reads the rows in a sequential manner; We need toClose()
theMySqlDataReader
object after use;ExecuteScalar
returns anobject
which can be type-casted into the appropriate data type.
Obrigado pelo seu feedback!