Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
CWNP exams CWNP
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
GIAC exams GIAC
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
ISEB exams ISEB
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

Microsoft 70-528(CSharp) Exam - Cheat-Test.com

Free 70-528(CSharp) Sample Questions:

1. Your Web site uses custom Themes. Your Web site must support additional Themes based on the user's company name.
The company name is set when a user logs on to the Web site. The company's Theme name is stored in a variable named ThemeName.
You need to use this variable to dynamically set the Web site's Theme.
What should you do?
A. Add the following code segment to the markup source of each page on the Web site.
<%@ Page Theme="ThemeName" ... %>
B. Add the following code segment to the Load event of each page on the Web site.
Page.Theme = ThemeName;
C. Add the following code segment to the PreInit event of each page on the Web site.
Page.Theme = ThemeName;
D. Add the following code segment to the Web site's configuration file.
<pages theme="ThemeName" />
Answer: C

2. You write a Web application. This application must support multiple languages. You store the localized strings in the application as resources. You want these resources to be accessed according to a user’s language preference. You create the following resource files in the App_GlobalResources folder of your application.
myStrings.resx
myStrings.en-CA.resx
myString.en-US.resx
myStrings.fr-CA.resx
myStrings.es-MX.resx
Each resource file stores a localized version of the following strings: Name, E-mail, Address, and Phone.
You create a Web Form that contains one label for each of these strings.
You need to ensure that the correct localized version of each string is displayed in each label, according to a user’s language preference.
What should you do?
A. Add the following configuration section to the Web.config file.
<globalization culture="Auto" />
B. Set the directive for each page in your site as follows:
<%@ Page UICulture="Auto" … %>
C. Add the following code segment to the page’s load event.
lblName.Text = @"{myStrings}Name";
lblAddress.Text = @"{myStrings}Address";
lblEmail.Text = @"{myStrings}Email";
lblPhone.Text = @"{myStrings}Phone";
D. Add the following code segment to the page’s load event.
lblName.Text = Resources.myStrings.Name;
lblAddress.Text = Resources.myStrings.Address;
lblEmail.Text = Resources.myStrings.Email;
lblPhone.Text = Resources.myStrings.Phone;
Answer: D

3. You create a Web Form. The Web Form displays sales information as a chart. The chart must be rendered to the user’s browser as a .jpeg file. The chart is retrieved by using the following code segment.
Bitmap chart = Chart.GetCurrentSales();
You need to display the chart to the user.
Which code segment should you use?
A. Response.ContentType = "image/jpeg";
chart.Save(Request.InputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
chart.Dispose();
B. Response.ContentType = "image/bitmap";
chart.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Bmp);
chart.Dispose();
C. Response.ContentType = "text/html";
chart.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.MemoryBmp);
chart.Dispose();
D. Response.ContentType = "image/jpeg";
chart.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
chart.Dispose();
Answer: D

4. You create aWeb Form. TheWeb Form allows users to calculate values and display the results in a label named lblResults.
You need to capture all unhandled exceptions on the Web Form through the Error event. The Error event must capture each unhandled exception and display it on the Web Form.
Which code segment should you use?
A. protected void Page_Error(object sender, EventArgs e) {
lblResults.Text = e.ToString();
e=null;
}
B. protected void Page_Error(object sender, EventArgs e) {
lblResults.Text = Server.GetLastError().ToString();
Server.ClearError();
}
C. protected void Page_Error(object sender, EventArgs e) {
Response.Write(e.ToString());
e=null;
}
D. protected void Page_Error(object sender, EventArgs e) {
Response.Write(Server.GetLastError().ToString());
Server.ClearError();
}
Answer: D

5. You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database.
When the user clicks the Update button on the FormView control, the application must validate that the user has entered data in all of the fields.
You need to ensure that the Web Form does not update if the user has not entered data in all of the fields.
Which code segment should you use?
A. protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) {
foreach (DictionaryEntry entry in e.Keys) {
if (entry.Value.ToString() == System.String.Empty) {
e.Cancel = true;
return;
}
}
}
B. protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e) {
foreach (DictionaryEntry entry in e.NewValues) {
if (entry.Value.Equals("")) {
e.KeepInEditMode = true;
return;
}
}
}
C. protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) {
foreach (DictionaryEntry entry in e.NewValues) {
if (entry.Value.Equals("")) {
e.Cancel = true;
return;
}
}
}
D. protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e) {
foreach (DictionaryEntry entry in e.Keys) {
if (entry.Value.ToString() == System.String.Empty) {
e.KeepInEditMode = true;
return;
}
}
}
Answer: C

6. You are creating a Web Form. You write the following code segment to create a SqlCommand object.
SqlConnection conn = new SqlConnection(connString);
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "select count(*) from Customers";
You need to display the number of customers in the Customers table.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. object customerCount = cmd.ExecuteScalar();
lblCompanyName.Text = customerCount.ToString();
B. int customerCount = cmd.ExecuteNonQuery();
lblCompanyName.Text = customerCount.ToString();
C. SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
lblCompanyName.Text = dr[0].ToString();
D. SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
lblCompanyName.Text = dr.ToString();
Answer: AC

7. You are creating a Web Form that displays product data. You create a DataView named dvOrders and bind it to a GridView.
You need to display the rows from dvOrders where the CategoryID is 2, in descending order of unit price.
Which code segment should you use?
A. dvOrders.Find("CategoryID = 2, UnitPrice desc");
dvOrders.Table.AcceptChanges();
B. dvOrders.RowFilter = "CategoryID = 2";
dvOrders.Sort = "UnitPrice desc";
C. dvOrders.Table.Select("UnitPrice desc", "Category = 2");
D. dvOrders.Table.Select("CategoryID = 2", "UnitPrice desc");
Answer: B

8. You are creating a Web Form to report on orders in a database. You create a DataSet that contains Order and OrderDetails tables. You add a relationship between the tables by using the following code segment.
DataTable dtOrders = dsOrders.Tables["Orders"];
DataTable dtOrderDetails =
dsOrders.Tables["OrderDetails"];
DataColumn colParent = dtOrders.Columns["OrderID"];
DataColumn colChild = dtOrderDetails.Columns["OrderID"];
dsOrders.Relations.Add("Rel1", colParent, colChild, false);
You need to calculate the total quantity of items for each order by adding the values in the Quantity column in the OrderDetails rows for each order.
Which code segment should you use?
A. foreach (DataRow parentRow in dtOrders.Rows) {
currQty = 0;
foreach (DataRow childRow in dtOrderDetails.Rows) {
currQty += Convert.ToInt32(childRow["Quantity"]);
}
ShowQty(currQty);
}
B. foreach (DataRow parentRow in dtOrders.Rows) {
currQty = 0;
foreach (DataRow childRow in
parentRow.GetChildRows("Rel1")) {
currQty += Convert.ToInt32(childRow["Quantity"]);
}
ShowQty(currQty);
}
C. foreach (DataRow childRow in dtOrders.Rows) {
currQty = 0;
foreach (DataRow parentRow in
childRow.GetParentRows("Rel1")) {
currQty += Convert.ToInt32(childRow["Quantity"]);
}
ShowQty(currQty);
}
D. foreach (DataRow parentRow in dtOrders.Rows) {
currQty = 0;
DataRow[] childRows = parentRow.GetChildRows("Rel1");
currQty += childRows.Length;
ShowQty(currQty);
}
Answer: B

9. You are creating a DataTable. You use the following code segment to create the DataTable. (Line numbers are included for reference only.)
01 DataTable dt = new DataTable("Products");
02 dt.Columns.Add(new DataColumn("Price", typeof(decimal)));
03 dt.Columns.Add(new DataColumn("Quantity", typeof(Int32)));
04 DataColumn dc = new DataColumn("Total", typeof(decimal));
05 dt.Columns.Add(dc);
You need to ensure that the Total column is set to the value of the Price column multiplied by the Quantity column when new rows are added or changed.
What should you do?
A. Add the following code segment after line 05.
dc.ExtendedProperties["Total"] = "Price * Quantity";
B. Add the following code segment after line 05.
dc.Expression = "Price * Quantity";
C. Write an event handler for the DataTable's TableNewRow event that updates the row's Total.
D. Write an event handler for the DataTable's ColumnChanged event that updates the row's Total.
Answer: B

10. You are creating a Web Form. The Web Form allows users to rename or delete products in a list. You create a DataTable named dtProducts that is bound to a GridView. DataTable has the following four rows.
dtProducts.Rows[0]["ProductName"] = "Soap";
dtProducts.Rows[1]["ProductName"] = "Book";
dtProducts.Rows[2]["ProductName"] = "Computer";
dtProducts.Rows[3]["ProductName"] = "Spoon";
dtProducts.AcceptChanges();
The user utilizes a Web Form to delete the first product.
You need to set the RowStateFilter property of the DataTable’s DefaultView so that only products that have not been deleted are shown.
To which value should you set the DataTables’s DefaultView.RowStateFilter?
A. DataViewRowState.ModifiedOriginal;
B. DataViewRowState.ModifiedCurrent;
C. DataViewRowState.CurrentRows;
D. DataViewRowState.Added;
Answer: C

11. Your Web site processes book orders. One of the application methods contains the following code segment.
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book><discount>10</discount>" +
"<title>Dictionary</title></book>");
You need to remove the discount element from XmlDocument.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. XmlNode root = doc.DocumentElement;
root.RemoveChild(root.FirstChild);
B. XmlNode root = doc.DocumentElement;
root.RemoveChild(root.SelectSingleNode("discount"));
C. doc.RemoveChild(doc.FirstChild);
D. doc.DocumentElement.RemoveChild(doc.FirstChild);
Answer: AB

12. You load an XmlDocument named doc with the following XML.
<bookstore>
<books>
<book genre="reference" >
<title>Dictionary</title>
</book>
<book genre="reference" >
<title>World Atlas</title>
</book>
</books>
</bookstore>
You need to change the value for the genre attribute to NA for all book attributes.
First, you add the following code segment to your class.
XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes("books/book");
Which additional two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. foreach (XmlNode node in nodes){
node.Attributes[0].Value = "NA";
}
B. foreach (XmlNode node in nodes){
node.Attributes[1].Value = "NA";
}
C. foreach (XmlNode node in nodes){
XmlNode genre = node.SelectSingleNode("/genre");
genre.Value = "NA";
}
D. foreach (XmlNode node in nodes){
XmlNode genre = node.SelectSingleNode("@genre");
genre.Value = "NA";
}
E. foreach (XmlNode node in nodes){
XmlNode genre = node.SelectSingleNode("genre");
genre.Value = "NA";
}
Answer: AD

13. You are creating a Web Form.
You need to include a user control on the Web Form.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)
A. <%@Register TagPrefix="Message" TagName="Fabrikam" Src="UserCtrl1.ascx" %>
B. <%@Register TagPrefix="Fabrikam" TagName="Message" Src="UserCtrl1.ascx" %>
C. Control c1 = LoadControl("UserCtrl1.ascx");
c1.Controls.Add(this);
D. <Fabrikam:Message runat="server"/>
Answer: BD

14. You develop a Web control to manage credit card information. The Web control is shown in the exhibit. (Not available in this free demo)
You register the control on the Web Form by using the following code segment.
<%@ Register Assembly="CreditCardUserDetails"
Namespace="CreditCardUserDetails" TagPrefix="cc1" %>
You need to declare the control on the Web Form.
Which code segment should you use?
A. <cc1:CreditCardDetails ID="CreditCardDetails1"
runat="server" Name="test">
</cc1:CreditCardDetails>
<asp:TextBox ID="TxtName" runat="server" Text="<%#CreditCardDetails1.Name%>">
</asp:TextBox>
B. <cc1:CreditCardDetails ID="CreditCardDetails1"
runat="server" Name="%#Container.Name%">
</cc1:CreditCardDetails>
C. <cc1:CreditCardDetails ID="CreditCardDetails1"
runat="server">
<Template>
<asp:TextBox ID="TxtName" runat="server"
Text="<%#Container.Name%>"></asp:TextBox>
</Template>
</cc1:CreditCardDetails>
D. <cc1:CreditCardDetails ID="CreditCardDetails1"
runat="server">
<Template>
<asp:TextBox ID="TxtName" runat="server"
Text="<%#Container.Template%>"></asp:TextBox>
</Template>
</cc1:CreditCardDetails>
Answer: C

15. You create a master page named Template.master. Template.master contains the following
ContentPlaceHolder server controls.
<asp:contentplaceholder id="area1" runat="server"/>
<asp:contentplaceholder id="area2" runat="server"/>
You also create 10 Web Forms. The Web Forms reference Template.master as their master page. Each Web Form has the following Content controls that correspond to the ContentPlaceHolder controls in Template.master.
<asp:Content ContentPlaceHolderID="area1" Runat="Server"/>
<asp:Content ContentPlaceHolderID="area2" Runat="Server"/>
You need to configure the Web pages so that default content will be shown in the area2
ContentPlaceHolder control whenever a Web Form does not provide that content.
What should you do?
A. Move default content inside area2 in Template.master. Remove area2 from Web Forms that do not provide content.
B. Move default content inside area2 in Template.master. Leave area2 blank in Web Forms that do not provide content.
C. Move default content inside area2 in the Web Forms. Remove area2 from Template.master.
D. Create an additional ContentPlaceHolder control in Template.master named area2_default. Place default content inside area2_default. Remove area2 from Web Forms that do not provide content.
Answer: A


© 2014 Cheat-Test.com, All Rights Reserved