using System; using System.Data.SqlClient; class Program { static void Main() { string connectionString = "Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True"; using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); SqlCommand command = new SqlCommand("SELECT * FROM Person.Person WHERE FirstName = @FirstName", connection); command.Parameters.AddWithValue("@FirstName", "John"); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { Console.WriteLine($"{reader["FirstName"]} {reader["LastName"]}"); } reader.Close(); } } }In this example, CreateCommand is used to create a new command object "command" that retrieves data from the Person.Person table in the AdventureWorks database where the FirstName column matches the value "John". The command object is then executed using ExecuteReader(), and the results are read and printed to the console.