Many people know getting Microsoft certification is very useful for their career but they fear failure because they hear it is difficult. Now I advise you to purchase our 70-516 premium VCE file. If you are not sure you can download our 70-516 VCE file free for reference. Please trust me if you pay attention on our 70-516 dumps VCE pdf you will not fail. We can guarantee you pass 70-516 exam 100%.
Why do we have this confidence to say that we are the best for 70-516 exam and we make sure you pass exam 100%? Because our premium VCE file has 80%-90% similarity with the real Microsoft 70-516 questions and answers. Once you finish our 70-516 dumps VCE pdf and master its key knowledge you will pass 70-516 exam easily. If you can recite all 70-516 dumps questions and answers you will get a very high score. Our standard is that No Help, Full Refund. No pass, No pay.
Instant Download: Our system will send you the 70-516 braindumps file you purchase in mailbox in a minute after payment. (If not received within 12 hours, please contact us. Note: don't forget to check your spam.)
Microsoft TS: Accessing Data with Microsoft .NET Framework 4 Sample Questions:
1. You use Microsoft .NET Framework 4.0 to develop an application that uses Entity Framework. The application includes the following Entity SQL (ESQL) query.
SELECT VALUE product FROM AdventureWorksEntities.Products AS product ORDER BY product.ListPrice
You need to modify the query to support paging of the query results. Which query should you use?
A) SELECT VALUE product FROM AdventureWorksEntities.Products AS product ORDER BY product.ListPrice SKIP @skip LIMIT @limit
B) SELECT TOP Stop VALUE product FROM AdventureWorksEntities.Products AS product ORDER BY product.ListPrice SKIP @skip
C) SELECT SKIP @skip VALUE product FROM AdventureWorksEntities.Products AS product ORDER BY product.ListPrice LIMIT @limit
D) SELECT SKIP @skip TOP Stop VALUE product FROM AdventureWorksEntities.Products AS product ORDER BY product.ListPrice
2. The database contains a table named Categories. The Categories table has a primary key identity column
named CategoryID.
The application inserts new records by using the following stored procedure.
CREATE PROCEDURE dbo.InsertCategory @CategoryName nvarchar(15), @Identity int OUT
AS INSERT INTO Categories (CategoryName) VALUES(@CategoryName) SET @Identity = SCOPE_IDENTITY() RETURN @@ROWCOUNT
You write the following code segment.
SqlDataAdapter adapter = new SqlDataAdapter("SELECT categoryID, CategoryName
FROM dbo.Categories",connection);
adapter.InsertCommand = new SqlCommand("dbo.InsertCategory", connection);
adapter.InsertCommand.CommandType = commandType.StoredProcedure;
adapter.InsertCommand.Parameters.Add(new SqlParameter("@CategoryName",
SqlDbType.NVarChar, 15,"CategoryName"));
You need to retrieve the identity value for the newly created record. Which code segment should you add?
A) SqlParameter parameter = adapter.InsertCommand.Parameters.Add("@CategoryName", SqlDbType.Int); parameter.Direction = ParameterDirection.Output; parameter = adapter.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 0, "CategoryID"); parameter.Direction = ParameterDirection.Output;
B) SqlParameter parameter = adapter.InsertCommand.Parameters.Add("@RowCount", SqlDbType.Int); parameter.Direction = ParameterDirection.ReturnValue; parameter = adapter.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 0, "CategoryID"); parameter.Direction = ParameterDirection.Output;
C) SqlParameter parameter = adapter.InsertCommand.Parameters.Add("@RowCount", SqlDbType.Int);
parameter.Direction = ParameterDirection.Output;
parameter = adapter.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 0, "CategoryID");
parameter.Direction = ParameterDirection.ReturnValue;
D) SqlParameter parameter = adapter.InsertCommand.Parameters.Add("@CategoryName", SqlDbType.Int); parameter.Direction = ParameterDirection.Output; parameter = adapter.InsertCommand.Parameters.Add("@Identity", SqlDbType.Int, 0, "CategoryID"); parameter.Direction = ParameterDirection.ReturnValue;
3. The entity data model must be configured to provide a way you cal the sp_FindObsolete stored procedure. The returned data must implement the Descendants property.
In Visual Studio 2010, you open the Add functions Import dialog box from the EDMX diagram and enter the information shown in the following graphic.
You need to complete the configuration in the dialog box. What should you do?
A) In the Returns a Collection Of area, click Scalars and then, in the Scalars list, click Int32
B) In the Returns a Collection Of area, click Entities and then, in the Entities list, click Component
C) In the Returns a Collection Of area, click Scalars and then, in the Scalars list, click string
D) Click the Get Column Information button, click Create New Complex Type and then, in the Complex box, enter Parts.
4. You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
You create a Database Access Layer (DAL) that is database-independent. The DAL includes the following
code segment.
(Line numbers are included for reference only.)
01 static void ExecuteDbCommand(DbConnection connection)
02 {
03 if (connection != null){
04 using (connection){
05 try{
06 connection.Open();
07 DbCommand command = connection.CreateCommand();
08 command.CommandText = "INSERT INTO Categories (CategoryName)
VALUES ('Low Carb')";
09 command.ExecuteNonQuery();
10 }
11 ...
12 catch (Exception ex){
13 Trace.WriteLine("Exception.Message: " + ex.Message);
14 }
15 }
16 }
17 }
You need to log information about any error that occurs during data access.
You also need to log the data provider that accesses the database. Which code segment should you insert
at line 11?
A) catch (DbException ex){ Trace.WriteLine("ExceptionType: " + ex.InnerException.Source);
Trace.WriteLine("Message: " + ex.InnerException.Message);
}
B) catch (OleDbException ex){ Trace.WriteLine("ExceptionType: " + ex.InnerException.Source);
Trace.WriteLine("Message: " + ex.InnerException.Message);
}
C) catch (DbException ex){ Trace.WriteLine("ExceptionType: " + ex.Source);
Trace.WriteLine("Message: " + ex.Message);
}
D) catch (OleDbException ex){ Trace.WriteLine("ExceptionType: " + ex.Source);
Trace.WriteLine("Message: " + ex.Message);
}
5. You use Microsoft .NET Framework 4.0 to develop an ASP.NET Web application that connects to a
Microsoft SQL Server 2008 database.
The application uses Integrated Windows authentication in Internet Information Services (IIS) to
authenticate users.
A connection string named connString defines a connection to the database by using integrated security.
You need to ensure that a SqlCommand executes under the application pool's identity on the database
server.
Which code segment should you use?
A) using (var conn = new SqlConnection())
{
conn.ConnectionString = connString;
SqlCommand cmd = null;
using (HostingEnvironment.Impersonate())
{
cmd = new SqlCommand("SELECT * FROM BLOG", conn);
}
conn.Open();
var result = cmd.ExecuteScalar();
}
B) using (var conn = new SqlConnection())
{
conn.ConnectionString = connString;
var cmd = new SqlCommand("SELECT * FROM BLOG", conn);
using (HostingEnvironment.Impersonate())
{
conn.Open();
}
var result = cmd.ExecuteScalar();
}
C) using (var conn = new SqlConneccion())
{
using (HostingEnvironroent.Impersonate())
{
conn.ConnectionString = connString;
}
var cmd = new SqlCommand("SELECT * FROM BLOG, conn);
conn.Open() ;
var result = cmd.ExecuteScalar();
}
D) using (var conn = new SqlConnection(connString))
{
var cmd = new SqlCommand ("SELECT * FROM BLOG, conn);
conn.Open();
using(HostingEnvironment.Impersonate())
{
var result = cmd.ExecuteScalar();
}
}
Solutions:
| Question # 1 Answer: A | Question # 2 Answer: B | Question # 3 Answer: B | Question # 4 Answer: C | Question # 5 Answer: B |



