[Pass Ensure VCE Dumps] PassLeader Free 70-516 Study Guide with 286q Questions and Answers (41-60)

100% Pass 70-516 Exam: if you are preparing 70-516 exam and want to pass it exam easily, we recommend you to get the new 286q 70-516 exam questions from PassLeader, we PassLeader now are sharing the latest and updated 70-516 braindumps with VCE and PDF file, we have corrected all the new questions of our 70-516 VCE dumps and 70-516 PDF dumps and will help you 100% passing 70-516 exam.

keywords: 70-516 exam,286q 70-516 exam dumps,286q 70-516 exam questions,70-516 pdf dumps,70-516 vce dumps,70-516 braindumps,70-516 practice tests,70-516 study guide,TS: Accessing Data with Microsoft .NET Framework 4 Exam

QUESTION 41
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. You create the classes shown in the following exhibit. You add the following code segment to the application. (Line numbers are included for reference only.)
01 public void QueryPlayers (List <League> leagues) {
02 …
03 }
You create a LINQ query to retrieve a collection of Player objects. You need to ensure that the collection includes all the players from each team and every league. Which code segment should you insert at line 02?


 
A.    var query = leagues.Select(l => l.Teams.Select(t => t.Players));
B.    var query = leagues.Select(l => l.Teams.SelectMany(t => t.Players));
C.    var query = leagues.SelectMany(l => l.Teams.SelectMany(t => t.Players));
D.    var query = leagues.SelectMany(l => l.Teams.Select(t => t.Players));

Answer: C

QUESTION 42
How do you call a model-defined function as static method on a custom class?

A.    Add a class to your application with a static method that does the following:
Apply an EdmFunctionAttribute to the method and ensure it accepts an IQueryable argument and returns the results of the Execute method that is returned by the Provider property.
B.    Add a class to your application with a static method that does the following:
Apply an EdmFunctionAttribute to the method and ensure it accepts IEntityWithRelationships argument and returns the results of the Execute method that is returned by the Provider property.
C.    Add a class to your application with a static method that does the following:
Apply an EdmFunctionAttribute to the method and ensure it accepts ICollection argument and returns the results of the Execute method that is returned by the Provider property.
D.    Add a class to your application with a static method that does the following:
Apply an EdmFunctionAttribute to the method and ensure it accepts and returns the results of the Execute method that is returned by the Provider property.

Answer: A

QUESTION 43
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(“@CategoryName”, SqlDbType.Int);
parameter.Direction = ParameterDirection.Output;
parameter = adapter.InsertCommand.Parameters.Add(“@Identity”, SqlDbType.Int, 0, “CategoryID”);
parameter.Direction = ParameterDirection.ReturnValue;
C.    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;
D.    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;

Answer: C

QUESTION 44
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. The application uses a Microsoft ADO.NET SQL Server managed provider.
“Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername; Password=secret;”
You need to ensure that the database credentials are secure. Which is the correct Property to insert?

A.    Integrated Security=SSPI;
B.    Persist Security Info=true;
C.    Persist Security Info=false;
D.    Integrated Security=false;

Answer: C
Explanation:
Persist Security Info
Default: ‘false’
When set to false or no (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.
Resetting the connection string resets all connection string values including the password.
Recognized values are true, false, yes, and no.
SSPI
http://msdn.microsoft.com/en-us/library/windows/desktop/aa380493(v=vs.85).aspx

QUESTION 45
You use Microsoft .NET Framework 4.0 to develop an ASP.NET application. The application uses Integrated Windows authentication. The application accesses data in a Microsoft SQL Server 2008 database that is located on the same server as the application. You use the following connection string to connect to the database:
Integrated Security=SSPI; Initial Catalog=AdventureWorks;
The application must also execute a stored procedure on the same server on a database named pubs. Users connect to the ASP.NET application through the intranet by using Windows-based authentication. You need to ensure that the application will use connection pooling whenever possible and will keep the number of pools to a minimum. Which code segment should you use?

A.    command.CommandText = “USE [pubs]; exec uspLoginAudit;”;
using (SqlConnection connection = new SqlConnection(“Initial Catalog=AdventureWorks; Integrated Security=SSPI; MultipleActiveResultSets=True”))
{
connection.Open();
command.ExecuteNonQuery();
}
B.    command.CommandText = “exec uspLoginAudit;”;
using (SqlConnection connection = new SqlConnection(“Integrated Security=SSPI;”))
{
connection.Open();
command.ExecuteNonQuery();
}
C.    command.CommandText = “USE [pubs]; exec uspLoginAudit;”;
using (SqlConnection connection = new SqlConnection(“Integrated Security=SSPI; Initial Catalog=AdventureWorks”))
{
connection.Open();
command.ExecuteNonQuery();
}
D.    command.CommandText = “exec uspLoginAudit;”;
using (SqlConnection connection = new SqlConnection(“Integrated Security=SSPI; Initial Catalog=pubs”))
{
connection.Open();
command.ExecuteNonQuery();
}

Answer: C
Explanation:
Working with Multiple Active Result Sets
http://msdn.microsoft.com/en-us/library/yf1a7f4f(v=vs.80).aspx
SSPI
http://msdn.microsoft.com/en-us/library/windows/desktop/aa380493(v=vs.85).aspx

QUESTION 46
You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to enhance and existing application use Entity Framework. The classes that represent the entites in the model are Plain old CLR Object (POCO) Classes. You need to connect the existing POCO classes to an entity framework context. What should you do?

A.    1. Generate a MetadataWorkspace and create an ObjectContext for the model.
2. Disable Proxy object creation on the ContextOptions of the ObjectContext.
3. Enable lazy loading on the ContextOptions of the ObjectContext.
B.    1. Generate a MetadataWorkspace and create an ObjectContext for the model.
2. Create an ObjectSet fort he POCO classes.
3. Disable Proxy object creation on the ContextOptions of the ObjectContext.
C.    1. Generate an Entity Data Model fort he POCO classes.
2. Create an ObjectSet fort he POCO classes.
3. Disable Proxy object creation on the ContextOptions of the ObjectContext.
4. Enable lazy loading on the ContextOptions of the ObjectContext.
D.    1. Generate an Entity Data Model for the POCO classes.
2. Create an ObjectSet for the POCO classes.
3. Set Code Generation Strategy on the Entity Data Model to none.
4. Create an ObjectContext for the model.

Answer: D

QUESTION 47
You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to develop an application. You use entity Framework Designer to create an Entity Data Model from an existing database by using the Generate From Database wizard. The model contains an entity type named Product. The Product type requires an additional property that is not mapped to database colomn. You need to add the property to product. What should you do?

A.    Add the property in the generated class file, and select Run Custom Tool from the solution menu.
B.    Add the property in a partial class named Product in a new source file.
C.    Create a comlex type with the name of the property in the Entity Framework Designer.
D.    Create a function import with the name of property in the Entity Framework Designer.

Answer: B

QUESTION 48
You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to develop an application that uses the Entity Framewok. You need to execute custom logic when an entity is attached to the ObjectContext. What should you do?

A.    Create a partial method named OnStateChanged in the partial class for the entity.
B.    Create a partial method named OnAttached in the partial class for the entity.
C.    Create an event handler to handle the ObjectStateManagerChanged event.
D.    Create an event handler to handle the ObjectMaterialized event.

Answer: C
Explanation:
ObjectStateManagerChanged Occurs when entities are added to or removed from the state manager.
ObjectMaterialized Occurs when a new entity object is created from data in the data source as part of a query or load operation.
ObjectStateManagerChanged Event
http://msdn.microsoft.com/en-us/library/system.data.objects.objectstatemanager.objectstatemanagerchanged.aspx
ObjectMaterialized Event
http://msdn.microsoft.com/en-us/library/system.data.objects.objectcontext.objectmaterialized.aspx

QUESTION 49
You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to develop an application that uses the Entity Data Model for the fallowing database tables. You need to ensure that the entity that is mapped to the ContectTypeDerived table derives from the entity that is mapped to the ContentTypeBase table. What should you do?

A.    Use a Table-Per-Type mapping method.
B.    Use a Table-Per-Hierarchy mapping method.
C.    Create a function import for each entity.
D.    Create a complect type for each entity.

Answer: A

QUESTION 50
You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. The application contains the following code segment:
string SQL = string.Format(“SELECT * FROM Customer WHERE CompanyName LIKE  ‘%{0}%’, companyName);
var cmd = new SqlCommand(SQL, con);
You need to reduce the vulnerability to SQL injection attacks. Which code segment should you use?

A.    string SQL = “SELECT * FROM Customer Where “ + “CompanyName LIKE @companyName”;
var cmd = new SqlCommand(SQL,con);
cmd.Parameters.AddWithValue(“@companyName”, string.Format(“%{0}%”, companyName));
B.    string SQL = “SELECT * FROM Customer Where “ + “CompanyName LIKE @companyName”;
var cmd = new SqlCommand(SQL,con);
var param = new SqlParameter (“@companyName”, string.Format(“%{0}%”, companyName));
C.    string SQL = string.Format(“SELECT * FROM “ + “ Customer Where CompanyName LIKE {0}”, new SqlCommand(“@companyName”, string.format(“%{0}%”, companyName)));
var cmd = new SqlCommand(SQL, con);
D.    string SQL = “SELECT” * FROM Customer @companyName;
var cmd = new sqlcommand(SQL,con);
cmd.Parameters.AddWithValue(“companyName”, string.format(“where companyName LIKE ‘%{0}%’”, companyName));

Answer: A
Explanation:
SqlParameterCollection.AddWithValue Method
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection.addwithvalue.aspx


http://www.passleader.com/70-516.html

QUESTION 51
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. WCF Data Services uses an authentication scheme that requires an HTTP request that has the following header format:
GET /Odata.svc/Products(1)
Authorization: WRAP access_token=”123456789”
The application includes the following code. (Line numbers are included for reference only.)
01 public class program
02 {
03 Public void GetProducts()
04 {
05 var proxy = new MyDataServiceContext(“…”);
06 …
07 }
08 }
You need to ensure that the correct authentication header is present when requests are made by using MyDataServiceContext. What should you do?

A.    Insert the following code segmen at line 06:
Proxy.Credentials = new NetworkCredential(“WRAP access_token”, “123456789”);
B.    Insert the following code segment at line 06:
Proxy.Credentials = new NetworkCredential(“Authorization”, “WRAP access_token=\”123456789”\””);
C.    Insert the following code segmen at line 06:
Proxy.SendingRequest += new EventHandler<SendingRequestEventArgs>(proxy_SendingRequest);
Insert the following code segmen at line 09:
void proxy_SendingRequest(object sender, SendingRequestEventArgs e){
e.RequestsHeaders.Add(“WRAP access_token”, “123456789”);
}
D.    Insert the following code segment at line 06:
Proxy.SendingRequest += new EventHandler<SendingRequestEventArgs>(proxy_SendingRequest);
Insert the following code segment at line 09:
void proxy_SendingRequest(object sender, SendingRequestEventArgs e){
RequestsHeaders.Add(“Authorization”, “WRAP access_token”, “123456789”);
}

Answer: D

QUESTION 52
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication Foundation (WCF) Data Services service. The solution contains the projects shown in the following table. The WCF data service exposes an Entity Framework model. You need to Access the service by using a WCF Data Services client. What should you do in the Application.Client Project?

A.    Add a referance to the Application.Model Project.
B.    Add a referance to the Application.Service Project.
C.    Add a service reference that uses the URL of the WCF data service.
D.    Add a web reference that uses the URL of the WCF data service.

Answer: C

QUESTION 53
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application contains the following XML document:
<bib>
<book title=”TCP/IP Illusrated” year=”1994″>
<author>Author1</author>
</book>
<book title=”Programming in UNIX” year=”1992″>
<author>Author1</author>
<author>Author2</author>
<author>Author3</author>
</book>
<book title=”Data on the web” year=”2000″>
<author>Author4</author>
<author>Author3</author>
</book>
</bib>
You add the following code fragment. (Line numbers are included for reference only.)
01 public IEnumerable<XElement> GetBooks(string xml)
02 {
03 XDocument doc = XDocument.Parse(xml);
04 …
05 }
You need to return a list of book XML element that are authored by Author1. Which code segment should you insert at line 04?

A.    return doc.Element(“bib”).Elements()
.SelectMany(el => el.Elements()
.Where(e2 => e2.Equals(new XElement(“author”, “Author1”))));
B.    return doc.Element(“bib”).Elements()
.SelectMany(el => el.Elements()
.Where(e2 => (string)e2 == “Author1”));
C.    return doc.Elements(“bib”).Elements()
.Where(e1 => e1.Elements().Any(e2 => (string)e2 == “Author1”));
D.    return doc.Elements(“bib”).Elements()
.Where(e1 => e1.Elements().Any(e2 => e2.Equals(new XElement(“author”, “Author1”))));

Answer: C

QUESTION 54
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 add the following store procedure to the database:
CREATE PROCEDURE GetProducts
AS
BEGIN
SELECT ProductID, Name, Price, Cost
FROM Product
END
You create a SqlDataAdapter named adapter to execute the stored procedure. You need to fill a DataTable instance with the first 10 rows of the result set. What are two possible code segments that you can use to achieve the goal?

A.    DataSet ds = new DataSet();
adapter.Fill(ds, 0, 10, “Product”);
B.    DataSet ds = new DataSet();
DataTable dt = ds.Tables.Add(“Product”);
adapter.Fill(0, 10, dt);
C.    DataSet ds = new DataSet();
DataTable dt = ds.Tables.Add(“Product”);
dt.ExtendedProperties[“RowCount”] = 10;
dt.ExtendedProperties[“RowIndex”] = 0;
adapter.Fill(dt);
D.    DataSet ds = new DataSet();
ds.ExtendedProperties[“RowCount”] = 10;
ds.ExtendedProperties[“RowIndex”] = 0;
adapter.Fill(ds);

Answer: AB
Explanation:
Fill(Int32, Int32, DataTable()) Adds or refreshes rows in a DataTable to match those in the data source starting at the specified record and retrieving up to the specified maximum number of records. (Inherited from DbDataAdapter.)
Fill(DataSet, Int32, Int32, String) Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names. (Inherited from DbDataAdapter.)
SqlDataAdapter Class
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx
DataTable.ExtendedProperties Gets the collection of customized user information.

QUESTION 55
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application retreives data from Microsoft SQL Server 2008 database named AdventureWorks. The AdventureWorks.dbo.ProductDetails table contains a column names ProductImages that uses a varbinary(max) data type. You write the following code segment. (Line numbers are included for reference only.)
01 SqlDataReader reader = command.ExecureReader(– empty phrase here –);
02 while(reader.Read())
03 {
04 pubID = reader.GetString(0);
05 stream = new FileStream(…);
06 writer = new BinaryWriter(stream);
07 startIndex = 0;
08 retval = reader.GetBytes(1, startIndex, outByte, 0, bufferSize);
09 while(retval == bufferSize)
10 {
11  …
12 }
13 writer.Write(outbyte, 0, (int)retval-1);
14 writer.Flush();
15 writer.Close();
16 stream.Close();
17 }
You need to ensure that the code supports streaming data from the ProductImages column. Which code segment should you insert at the empty phrase in line 01?

A.    CommandBehavior.Default
B.    CommandBehavior.KeyInfo
C.    CommandBehavior.SingleResult
D.    CommandBehavior.SequentialAccess

Answer: D
Explanation:
Default
The query may return multiple result sets. Execution of the query may affect the database state.
Default sets no CommandBehavior flags, so calling ExecuteReader(CommandBehavior.Default) is functionally equivalent to calling ExecuteReader().
KeyInfo The query returns column and primary key information. When KeyInfo is used for command execution, the provider will append extra columns to the result set for existing primary key and timestamp columns.
SingleResult The query returns a single result set.
SequentialAccess Provides a way for the DataReader to handle rows that contain columns with large binary values.
Rather than loading the entire row, SequentialAccess enables the DataReader to load data as a stream.
You can then use the GetBytes or GetChars method to specify a byte location to start the read operation, and a limited buffer size for the data being returned.
CommandBehavior Enumeration
http://msdn.microsoft.com/en-us/library/system.data.commandbehavior.aspx

QUESTION 56
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. The application performs a database query within a transaction. You need to ensure that the application can read data that has not yet beed commited by other transactions. Which IsolationLevel should you use?

A.    ReadUncommitted
B.    ReadCommitted
C.    RepeatableRead
D.    Unspecified

Answer: A
Explanation:
Unspecified A different isolation level than the one specified is being used, but the level cannot be determined.
When using OdbcTransaction, if you do not set IsolationLevel or you set IsolationLevel to Unspecified, the transaction executes according to the isolation level that is determined by the driver that is being used.
Chaos The pending changes from more highly isolated transactions cannot be overwritten. ReadUncommitted A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored.
ReadCommitted Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data.
RepeatableRead Locks are placed on all data that is used in a query, preventing other users from updating the data.
Prevents non-repeatable reads but phantom rows are still possible.
Serializable A range lock is placed on the DataSet, preventing other users from updating or inserting rows into the dataset until the transaction is complete.
Snapshot Reduces blocking by storing a version of data that one application can read while another is modifying the same data.
Indicates that from one transaction you cannot see changes made in other transactions, even if you requery.
IsolationLevel Enumeration
http://msdn.microsoft.com/en-us/library/system.data.isolationlevel.aspx
Isolation Levels in Database Engine
http://msdn.microsoft.com/en-us/library/ms189122.aspx
SET TRANSACTION ISOLATION LEVEL (Transact-SQL)
http://msdn.microsoft.com/ru-ru/library/ms173763.aspx

QUESTION 57
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. The application includes a SqlConnection named conn and a SqlCommand named cmd. You need to create a transaction so that database changes will be reverted in the event that an exception is thrown. Which code segment should you use?

A.    var transaction = conn.BeginTransaction();
cmd.Transaction = transaction;
try
{

transaction.Commit();
}
catch
{
transaction.Rollback();
}
B.    var transaction = conn.BeginTransaction();
cmd.Transaction = transaction;
try
{

transaction.Commit();
}
catch
{
transaction.Dispose();
}
C.    var transaction = conn.BeginTransaction();
cmd.Transaction = transaction;
try
{

}
catch
{
transaction.Commit();
}
D.    var transaction = conn.BeginTransaction();
cmd.Transaction = transaction;
try
{

transaction.Rollback();
}
catch
{
transaction.Dispose();
}

Answer: A

QUESTION 58
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You create a stored procedure to insert a new record in the Categories table according to following code segment:
CREATE PROCEDURE dbo.InsertCategory
@CategoryName navrchar(15),
@Identity int OUT
AS
  INSERT INTO Categories(CategoryName) VALUES (@CategoryName)
  SET @Identity = SCOPE_IDENTITY()
  RETURN @@ROWCOUNT
You add the following code fragment. (Line numbers are included for reference only.)
01 private static void ReturnIdentity(string connectionString)
02 {
03    using(SqlConnection connection = new SqlConnection(connectionString))
04  {
05 SqlDataAdpater adapter = new SqlDataAdapter(“SELECT CategoryID, CategoryName FROM dbo.Categories”, connection);
06 adapter.InsertCommand = new SqlCommand(“InsertCategory”, connection);
07 adapter.InsertCommand.CommandType = CommandType.StoredProcedure;
08 SqlParameter rowcountParameter = adapter.InsertCommand.Parameters.Add(“@RowCount”, SqlDbType.Int);
09 …
10 adapter.InsertCommand.Parameters.Add(“@CategoryName”, SqlDbType.NChar, 15, “CategoryName”);
11 SqlParameter identityParameter = adapter.InsertCommand.Parameters.Add(“@Identity”, SqlDbType.Int, 0, “CategoryID”);
12 …
13 DataTable categories = new DataTable();
14 adapter.Fill(categories);
15 DataRow ctegoryRow = categories.NewRow();
16 categoryRow[“CategoryName”] = “New beverages”;
17 categories.Rows.Add(categoryRow);
18 adapter.Update(categories);
19 Int32 rowCount = (Int32)adapter.InsertCommand.Parameters[“@RowCount”].Value;
20  }
21 }
Which code elements needs to be added in the empty lines?

A.    Insert the following code segment at line 09:
rowcountParameter.Direction = ParameterDirection.ReturnValue;
Insert the following code segment at line 12:
identityParameter.Direction = ParameterDirection.ReturnValue;
B.    Insert the following code segment at line 09:
rowcountParameter.Direction = ParameterDirection.Output;
Insert the following code segment at line 12:
identityParameter.Direction = ParameterDirection.Output;
C.    Insert the following code segment at line 09:
rowcountParameter.Direction = ParameterDirection.ReturnValue;
Insert the following code segment at line 12:
identityParameter.Direction = ParameterDirection.Output;
D.    Insert the following code segment at line 09:
rowcountParameter.Direction = ParameterDirection.Output;
Insert the following code segment at line 12:
identityParameter.Direction = ParameterDirection.ReturnValue;

Answer: C

QUESTION 59
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the EntityFramework. The application has an entity named Person. A Person instance named person1 and an ObjectContext instance named model exist. You need to delete the person1 instance. Which code segment should you use?

A.    model.DeleteObject(person1);
model.SaveChanges();
B.    model.Detach(person1);
model.SaveChanges();
C.    model.ExecuteStoreCommand(“Delete”,
new []{new ObjectParameter(“Person”, person1)};
model.SaveChanges();
D.    model.ExecuteStoreCommand(“Detach”,
new []{new ObjectParameter(“Person”, person1)};
model.SaveChanges();

Answer: A
Explanation:
ObjectContext.DeleteObject Marks an object for deletion from the ObjectStateManager. The object is deleted in the data source when the SaveChanges method is called. ObjectContext.ExecuteStoreCommand Method executes an arbitrary command directly against the data source using the existing connection.

QUESTION 60
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that connects to a MS SQL server 2008 database by User Authentication. The application contains the following connection string:
SERVER=DBSERVER-01; DATABASE=pubs; uid=sa; pwd=secret;
You need to ensure that the password value in the connection string property of a SqlConnection object does not exist after is called. What should you add to the connection string?

A.    Persist Security Info = True
B.    Trusted_Connection = True
C.    Persist Security Info = False
D.    Trusted_Connection = False

Answer: C
Explanation:
The Persist Security Info property specifies whether the data source can persist sensitive authentication information such as a password.
Persist Security Info Property
http://msdn.microsoft.com/en-us/library/aa214039(v=sql.80).aspx


http://www.passleader.com/70-516.html

         

Comments are closed.