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
ExecuteNonQueryfor commands which modify the database; ExecuteReaderandExecuteScalarare for querying commands that retrieve data from the database;ExecuteReaderreturns aMySqlDataReaderobject;MySqlDataReaderhas a method calledread()which reads the rows in a sequential manner; We need toClose()theMySqlDataReaderobject after use;ExecuteScalarreturns anobjectwhich 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?
ãã¹ãŠæç¢ºã§ãããïŒ
ãã£ãŒãããã¯ããããšãããããŸãïŒ
ã»ã¯ã·ã§ã³Â 1. ç« Â 25
AIã«è³ªåãã
AIã«è³ªåãã
äœã§ã質åããããææ¡ããã質åã®1ã€ã詊ããŠãã£ãããå§ããŠãã ãã