Scenario: You are developing an application that needs to execute a complex SQL query with parameters. Which ADO.NET object would you use for this task?

  • SqlCommand
  • SqlConnection
  • SqlDataAdapter
  • SqlDataReader
SqlCommand is used to execute SQL commands, including complex queries, with parameters. It allows for parameterized queries, reducing the risk of SQL injection attacks and enhancing performance by reusing execution plans.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *