News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

MCPD- Exam 70-515: Web Applications Development with Microsoft .NET Framework 4

  1. <configuration>
    <system.net>
    <mailSettings>
    <smtp configSource="smtp.config" allowOverride="true">
    <network host="127.0.0.1" port="25"/>
    </smtp>
    </mailSettings>
    </system.net>
    </configuration> 
  2. <configuration>
    <system.net>
    <mailSettings>
    <smtp configSource="smtp.config" />
    </mailSettings>
    </system.net>
    </configuration>
  3. <configuration xmlns:xdt="http://schemas.microsoft.com/XML- Document-Transform">
    <location path="smtp.config" xdt:Transform="Replace"
    xdt:Locator="Match(path)">
    <system.net />
    </location>
    </configuration>
  4. <configuration>
    <location path="smtp.config">
    <system.net>
    <mailSettings>
    <smtp Devilery Method="Network" >
    <Network Host = "127.0.0.1" Port="25"/>
    </smtp>
    </mailSettings>
    </system.net>
    </location>
    </configuration>
Answer: Answer is b

  1. Run the aspnet_regiis.exe command

  2. Set the Treat warnings as errors option to All in the project properties and recompile.

  3. Add the following rule to the <healthMonitoring/> section of the web.config file.

    <rules>
    <add name="Failures"
    eventName="Failure Audits"
    provider="EventLogProvider" />
    </rules>
  4. Add the following rule to the <healthMonitoring/> section of the web.config file.

    <rules>
    <add name="Errors"
    eventName="All Errors"
    provider="EventLogProvider" />
    </rules>
Answer: Answer is d

  1. dtlView.DataSource = GetCustomerOrderDataSet();
    dtlView.DataMember = "OrderDetailsTable";
    dtlView.DataBind();
    
  2. dtlView.DataSource = GetCustomerOrderDataSet();
    dtlView.DataSourceID = "OrderDetailsTable";
    dtlView.DataBind();
    
  3. dtlView.DataSource = GetCustomerOrderDataSet();
    dtlView.DataKeyNames = new string [] { "OrderDetailsTable"}; dtlView.DataBind();
    
  4. DataSet dataSet = GetCustomerOrderDataSet();
    dtlView.DataSource = new DataTable("dataSet", "OrderDetailsTable"); dtlView.DataBind();
    
Answer: Answer is a

<asp:ObjectDataSource SelectMethod="GetProductByProductId" ID="odc" runat="server" TypeName="ProductDAL">
<SelectParameters>
<asp:Parameter Name="productId" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>

The page will be called with a query string field named pid. You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductId method. What should you do?

  1. Replace the asp:QueryStringParameter with the following declaration.

    <asp:QueryStringParameter DefaultValue="pid" Name="productId" Type="Int32" />
  2. Replace the asp:QueryStringParameter with the following declaration.

     <asp:QueryStringParameter QueryStringField="pid" Name="productId" Type="Int32" />
  3. Add the following event handler to the Selecting event of the ObjectDataSource control.

    protected void odc_Selecting(object sender,ObjectDataSourceSelectingEventArgs e)
    {
    }
  4. InputParameters["pid"] = Request.QueryString["productId"]; }
    
  5. Add the following code segment to the page's code-behind.

    protected void Page_Load(object sender, EventArgs e)
    {
    odc.SelectParameters.Add("productId", Request.QueryString["pid"]);
    }
    
Answer: Answer is b

<asp:SqlDataSource id="sqlds" runat="server" ConnectionString="<%$ ConnectionStrings:MyDB %>" SelectCommand="SELECT * FROM Companies" />

The page is accessed frequently, but the data in the database rarely changes. You need to cache the retrieved data so that the database is not queried each time the Web page is accessed. What should you do?

  1. Add the following attributes to the SqlDataSource control.

    DataSourceMode="DataSet"
    EnableCaching="True"
    CacheDuration="120"
    
  2. Add the following attributes to the SqlDataSource control.

    DataSourceMode="DataReader"
    EnableCaching="True"
    CacheDuration="120"
    
  3. Add the following configuration to the <system.web/> section of the web.config file.

    <caching>
    <sqlCacheDependency enabled="true">
    <databases>
    <add name="MyDBCache"
    connectionStringName="MyDB"
    pollTime="120" />
    </databases>
    </sqlCacheDependency>
    </caching>
  4. Add the following configuration to the <system.web/> section of the web.config file.

    <caching>
    <sqlCacheDependency enabled="true" pollTime="120">
    <databases>
    <add name="MyDBCache"
    connectionStringName="MyDB" />
    </databases>
    </sqlCacheDependency>
    </caching>
Answer: Answer is a

public string JsonValue;
List people = GetPeopleList();
JavaScriptSerializer json = new JavaScriptSerializer();

You need to use the JavaScriptSerializer class to serialize only the Name property of each item in the people list. Which code segment should you use?

  1. JsonValue = json.Serialize(people.Select(p => p.Name));
    
  2. var names = from person in people
    select person;
    JsonValue = "{" + json.Serialize(names) + "}";
    
  3. JsonValue = json.Serialize(people.SelectMany( p =>p.Name.AsEnumerable()));
    
  4. var names = from person in people
    select person;
    JsonValue = json.Serialize(names);
    
Answer: Answer is a

private NorthwindContext _entities;
public void UpdatePerson(Person personToEdit)
{
}

You need to implement the UpdatePerson method to update the database row that corresponds to the personToEdit object. Which code segment should you use?

  1. _entities.People.Attach(personToEdit);
    _entities.ObjectStateManager.ChangeObjectState(
    personToEdit,
    EntityState.Modified);
    _entities.SaveChanges();
    
  2. _entities.ObjectStateManager.ChangeObjectState(
    personToEdit,
    EntityState.Added);
    _entities.SaveChanges();
    
  3. _entities.People.ApplyCurrentValues(personToEdit);
    _entities.SaveChanges();
    
  4. _entities.People.Attach(new Person() { Id = personToEdit.Id }); _entities.ObjectStateManager.
    ChangeObjectState(
    personToEdit,
    EntityState.Modified);
    _entities.SaveChanges();
    
Answer: Answer is a

public List GetNonSecretUsers()
{
string[] secretUsers = {"@secretUser", "@admin", "@root"}; List allpeople = GetAllPeople();
... }

You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list. The resulting list must not contain duplicates. Which code segment should you use?

  1. var secretPeople = (from p in allPeople
    from u in secretUsers
    where p.UserId == u
    select p).Distinct();
    return allPeople.Except(secretPeople);
    
  2. return from p in allPeople
    from u in secretUsers
    where p.UserId != u
    select p;
    
  3. return (from p in allPeople
    from u in secretUsers
    where p.UserId != u
    select p).Distinct();
    
  4. List people = new List(
    from p in allPeople
    from u in secretUsers
    where p.UserId != u
    select p);
    return people.Distinct();
    
Answer: Answer is a

public class ProductService :
System.Web.Services.WebService
{
public List GetProducts(int categoryID)
{
return GetProductsFromDatabase(categoryID);
}
}

You need to ensure that the GetProducts method can be called by using AJAX. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

  1. Apply the WebService attribute to the ProductService class.

  2. Apply the ScriptService attribute to the ProductService class.

  3. Apply the WebMethod attribute to the GetProducts method.

  4. Apply the ScriptMethod attribute to the GetProducts method.

Answer: Answer is b, c

namespace ContosoWCF
{
[ServiceContract]
public interface IRateService
{
[OperationContract]
decimal GetCurrentRate();
}
public partial class RateService : IRateService
{
public decimal GetCurrentRate()
{
decimal currentRate = GetRateFromDatabase();
return currentRate;
}
}
}

You build the service library and deploy its assembly to an IIS application. You need to ensure that the GetCurrentRate method can be called from JavaScript. What should you do?

  1. Add a file named Service.svc to the IIS application.
    Add the following code segment to the file.

    <%@ ServiceHost Service="ContosoWCF.IRateService" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %>
    
  2. Add a file named Service.svc to the IIS application.
    Add the following code segment to the file.

    <%@ ServiceHost Service="ContosoWCF.RateService" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %>
    
  3. Apply the script service attribute to rate serice class Rebulid the WCF servicelibrary, and redploy the assembly to the IIS application.

  4. Apply the Web get attibute to the Get Currant rate interface Method.Rebuild the WCF servicelibrary, and redploy the assembly to the IIS application.

Answer: Answer is b

Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;