Question: 16. (A) You need to create an OleDbCommand object to retrieve information about postal codes for your mailing list application. You create an OleDbConnection object named conn. You need to instantiate the OleDBCommand object and set the CommandText and Connection properties. What are two possible code segments for you to use? (Each correct answer presents a complete solution. Choose two)
Exam Name: Developing Windows-based Applications with Microsoft Visual Basic .NET Exam Type: Microsoft Exam Code: 70-306 Doc Type: Q&A with Explanations Total Questions: 255 Page 12 of 159 comm.CommandText = “SELECT * FROM Regions” comm.Connection = conn B. Dim comm. As New OleDbCommand(“sp_GetRegions”, conn) comm.CommandType = CommandType.Text C. Dim comm As New OleDbCommand(“SELECT * FROM Regions”, _ conn) comm.CommandType = CommandType.Text D. Dim comm As New OleDbCommand(“sp_GetRegions”, conn) comm.CommandType = CommandType.TableDirect E. Dim comm As New OleDbCommand() comm.CommandType = “SELECT * FROM Regions” comm.Connection = conn Question: 17. (A) You develop a Windows-based application XYZiApp by using Visual Studio .NET. XYZiApp uses a SqlConnection object for database access. You typically run XYZiApp on a computer that has limited RAM and hard disk space. After the code finishes using the SqlConnection object, you must ensure that the connection is closed and that any resources consumed by the object are released immediately. What should you do?
Explanation:
Exam Name: Developing Windows-based Applications with Microsoft Visual Basic .NET Exam Type: Microsoft Exam Code: 70-306 Doc Type: Q&A with Explanations Total Questions: 255 Page 13 of 159 SqlConnection.Dispose Method releases the unmanaged resources used by the SqlConnection

You've reached the end of your free preview.
Want to read all 159 pages?
- Spring '16
- .NET Framework, Microsoft Visual Studio