Which of the following?
There are Entities – States Class, Cities class. Deleting of state id raises exception. Which of the
following?
Which two actions should you perform?
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database. The database contains a ClassStudent table that contains the StudentID for
students who are enrolled in the classes.
You add the following stored procedure to the database.
CREATE PROCEDURE [dbo].[GetNumEnrolled]
@ClassID INT,
@NumEnrolled INT OUTPUT
AS
BEGIN
SET NOCOUNT ON
SELECT @NumEnrolled = COUNT(StudentID)
FROM ClassStudent
WHERE (ClassID = @ClassID)
END
You write the following code. (Line numbers are included for reference only.)
01 private int GetNumberEnrolled(string classID)
02 {
03 using (SqlConnection conn = new SqlConnection(GetConnectionString())
04 {
05 SqlCommand cmd = new SqlCommand(“GetNumEnrolled”, conn);
06 cmd.CommandType = CommandType.StoredProcedure;
07 SqlParameter parClass = cmd.Parameters.Add(“@ClassID”, SqlDbType.Int, 4,
“classID”);
08 SqlParameter parNum = cmd.Parameters.Add(“@NumEnrolled”, SqlDbType.Int);
09 …
10 conn.Open()
11 …
12 }
13 }
You need to ensure that the GetNumberEnrolled method returns the number of students who are
enrolled for a specific class.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose
two.)
You need to ensure that the application calls a stored procedure that accepts a table-valued parameter
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database. You need to ensure that the
application calls a stored procedure that accepts a table-valued parameter. You create a
SqlParameter object. What should you do next?
Which code segment should you use?
You use Microsoft Visual Studio 2010 and Microsoft Entity Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database. You use the ADO.NET LINQ to SQL
model to retrieve data from the database. The applications contains the Category and Product
entities as shown in the following exhibit:
You need to ensure that LINO to SQL executes only a single SQL statement against the database. You
also need to ensure that the query returns the list of categories and the list of products. Which code
segment should you use?
Get workflow data as well as related workstepflow.
Class Workflow – Has Workstepflow inside. Get workflow data as well as related workstepflow.
You need to create a query that generates the new XML result
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application. A
file named books.xml contains the following XML.
<bib>
<book title=”Programming in Unix” year=”1992″>
<author>Author1</author>
<author>Author2</author>
<author> Author 3 </author>
</book>
</bib>
The application must generate an XML result that contains an XML element named BookTitle for
each book.
The text content of the element must contain the title of the book.
You need to create a query that generates the new XML result. What should you do?
Which code segment should you use?
You use Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL
Server 2008 database.
You add the following stored procedure to the database.
CREATE PROCEDURE [dbo].[InsertTag]
@Name nvarchar (15)
AS
INSERT INTO [dbo].[Tags] (Name) VALUES(@Name)
RETURN @@ROWCOUNT
You need to invoke the stored procedure by using an open SqlConnection named conn.
Which code segment should you use?
Which two actions should you perform?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application uses the ADO.NET Entity Framework to manage Plain Old CLR Objects (POCO)
entities. You create a new POCO class. You need to ensure that the class meets the following
requirements:
It can be used by an ObjectContext.
It is enabled for change-tracking proxies.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose
two.)
You need to ensure that users cannot read passwords extracted from the database
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database. The application stores user names and
passwords in the database. You need to ensure that users cannot read passwords extracted from the
database. What should you do?
Which of the following is the correct connection string?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server 2008 database. You must retrieve a connection
string. Which of the following is the correct connection string?