You need to execute a stored procedure in ADO.NET that inserts data into a database table. Which ADO.NET object would you use for this task, and how would you pass the necessary parameters?

  • SqlCommand
  • SqlDataAdapter
  • SqlConnection
  • SqlDataReader
SqlCommand is the correct option. It represents a Transact-SQL statement or stored procedure to execute against a SQL Server database. Parameters can be passed using the SqlCommand.Parameters collection. SqlDataReader is used for reading a forward-only stream of rows. SqlConnection represents a connection to a SQL Server database. SqlDataAdapter is used to fill a DataSet and update a SQL Server database.
Add your answer
Loading...

Leave a comment

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