Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
MySqlCommand Methods | Introduction to Databases with .NET
Introduction to .NET with C#
course content

Зміст курсу

Introduction to .NET with C#

Introduction to .NET with C#

1. Introduction
2. Asynchronous Programming and Introduction to Web Services
3. Introduction to Databases with .NET
4. CRUD Operations with MySQL
5. Optimizing Database Operations

bookMySqlCommand 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 and ExecuteScalar are for querying commands that retrieve data from the database;
  • ExecuteReader returns a MySqlDataReader object;
  • MySqlDataReader has a method called read() which reads the rows in a sequential manner; We need to Close() the MySqlDataReader object after use;
  • ExecuteScalar returns an object which can be type-casted into the appropriate data type.
1. The following command selects and returns all the students that have marks higher than 90, which command is the most appropriate for executing this query?
2. The following command selects and returns the name of the oldest student in the class, which command is the most appropriate for executing this query?
The following command selects and returns all the students that have marks higher than 90, which command is the most appropriate for executing this query?

The following command selects and returns all the students that have marks higher than 90, which command is the most appropriate for executing this query?

Виберіть правильну відповідь

The following command selects and returns the name of the oldest student in the class, which command is the most appropriate for executing this query?

The following command selects and returns the name of the oldest student in the class, which command is the most appropriate for executing this query?

Виберіть правильну відповідь

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 8
We're sorry to hear that something went wrong. What happened?
some-alt