GIAC
GSSP-NET · Question #484
Peter works as a Software Developer for PaulTech Inc. He develops an application for office management, using Visual C# .NET. He creates an OleDbConnection object, named Pcon. He wants to create an…
The correct answer is C. PCommand.Connection = Pcon; D. PCommand.CommandText = "SELECT * FROM Employees"; F. OleDbCommand PCommand = new OleDbCommand(). See the full explanation below for the reasoning.
Question
Peter works as a Software Developer for PaulTech Inc. He develops an application for office management, using Visual C# .NET. He creates an OleDbConnection object, named Pcon. He wants to create an OleDbCommand object to retrieve employee details. Which of the following statements will Peter use to set the CommandText and Connection properties to accomplish the required task? Each correct answer represents a part of the solution. Choose three.
Options
- AOleDbCommand PCommand = new OleDbCommand("sp_GetDetails", PCon);
- BPCommand.CommandType = "SELECT * FROM Employees";
- CPCommand.Connection = Pcon;
- DPCommand.CommandText = "SELECT * FROM Employees";
- EPCommand.SetConnection (PCon);
- FOleDbCommand PCommand = new OleDbCommand();
How the community answered
(33 responses)- A3% (1)
- B6% (2)
- C82% (27)
- E9% (3)
Community Discussion
No community discussion yet for this question.