nerdexam
Microsoft

70-516 · Question #97

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You use the ADO.NET Entity Framework Designer…

The correct answer is A. using (SchoolEntities context = new SchoolEntities()). procedure-output-parametersin-entity-framework.aspx

Implementing Data Access

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that connects to a Microsoft SQL Server 2008 database. You use the ADO.NET Entity Framework Designer to model entities. You add the following stored procedure to the database, and you add a function import to the model. CREATE PROCEDURE [dbo].[InsertDepartment] @Name nvarchar(50), @ID int NULL OUTPUT AS INSERT INTO Department (Name) VALUES (@Name) SELECT @ID = SCOPE_IDENTITY() You need to insert a new department and display the generated ID. Which code segment should you use?

Options

  • Ausing (SchoolEntities context = new SchoolEntities())
  • Busing (SchoolEntities context = new SchoolEntities())
  • Cusing (SchoolEntities context = new SchoolEntities())
  • Dusing (SchoolEntities context = new SchoolEntities())

How the community answered

(56 responses)
  • A
    79% (44)
  • B
    2% (1)
  • C
    7% (4)
  • D
    13% (7)

Explanation

procedure-output-parametersin-entity-framework.aspx

Topics

#Entity Framework#stored procedure#function import#OUTPUT parameter

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice