Tips to Pass 70-526 Exam (1 to 15)

70-526 Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library! Try it Free Today!

https://www.exambible.com/70-526-exam/

Product Description:
Exam Number/Code: 70-526
Exam name: Microsoft .NET Framework 2.0 - Windows-based Client Development is in development
n questions with full explanations
Certification: Microsoft Certification
Last updated on Global synchronizing

Free Certification Real IT 70-526 Exam pdf Collection

Exam Code: 70-526 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Microsoft .NET Framework 2.0 - Windows-based Client Development is in development
Certification Provider: Microsoft
Free Today! Guaranteed Training- Pass 70-526 Exam.

2016 Apr 70-526 Study Guide Questions:

Q1. You create a new custom control by extending a standard TextBox control. You need to replace the default icon for the control with your own custom icon. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Add the bitmap file that contains the custom icon to the custom control project. Set its BuildAction property to Compile in the Properties window.

B. Add the bitmap file that contains the custom icon to the custom control project. Decorate the control class with the ToolboxBitmap attribute, and specify the location of the bitmap file for the icon.

C. Add the bitmap file that contains the custom icon to the custom control project. Give the bitmap file the same name as your control class, and use the .bmp or .ico file name extension. Set its BuildAction property to EmbeddedResource in the Properties window.

D. Add the bitmap file that contains the custom icon to the custom control project. Give the bitmap file the same name as your control class, and use the .bmp or .ico file name extension. Set the Copy to Output Directory property of the bitmap to Copy always.

Answer: BC


Q2. You are creating an application named App1. You use ClickOnce deployment to distribute App1.exe and multiple assemblies. Some users require only some of the functionality in App1. You need to limit the size of the initial download of the application. You also need to ensure that users can download the assemblies on demand. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.)

A. Mark each dependency in App1.exe.manifest as optional.

B. Mark each dependency in App1.application as optional.

C. Create an event handler for the AppDomain.ResourceResolve event named ResolveAssembly.

D. Create an event handler for the AppDomain.AssemblyLoad event named ResolveAssembly.

E. In the ResolveAssembly event handler, set the ApplicationDeployment.CurrentDeployment.ActivationUri property to the location of your required assembly.

F. In the ResolveAssembly event handler, call ApplicationDeployment.DownloadFiles and pass in the name of the assembly you want.

Answer: ACF


Q3. You are testing an installation package for a Windows Forms application. You notice that the installed application will not run on client computers that do not have the .NET Framework installed. You need to ensure that when a user installs the application on his or her client computer, the .NET Framework is also installed. What should you do?

A. Select the .NET Framework in the Dependencies property value in the project's property grid.

B. Verify that the .NET Framework redistributable package check box is selected under the Prerequisites button on the Setup property pages.

C. Add the .NET Framework redistributable package to the setup project in the File System Editor.

D. Create a Custom Actions Editor that copies the .NET Framework redistributable package to the applications root directory.

Answer: B


Q4. You are building a custom extended button control. This control handles its own painting by displaying a particular metric value in the upper right corner of the button, as shown in the exhibit. (Click the Exhibit button.)  You test this feature and verify that it works correctly. You also want the displayed value to be updated in real time as the user uses the application. You override the OnPaint method of the control to raise the Paint event when required. Your project compiles and builds with no problems, but the control does not paint itself correctly. You need to ensure that the control paints itself correctly. What should you do?


A. Call the base OnPaint method of the class from within your OnPaint method.

B. Raise the Paint event handler from within the OnPaint method.

C. Call the OnPaint method of the base class from within the Paint event.

D. Use the DefaultEvent attribute on your control class to specify that events will correctly ripple down the event chain from the base class to your current instance.

Answer: A


Q5. You are customizing a Windows Form to asynchronously update a database in a method named WorkHandler. You need to ensure that the form displays a message box to the user that indicates the success or failure of the update. Which code segment should you use?

A. private void StartBackgroundProcess() {

bgwExecute.DoWork += new DoWorkEventHandler(WorkHandler);

bgwExecute.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompletedHandler);

bgwExecute.RunWorkerAsync();

}

void CompletedHandler(object sender, RunWorkerCompletedEventArgs e) {

bool result = (bool)e.Result;

MessageBox.Show("Update " + (result ? "was successful" : "failed"));

}

void WorkHandler(object sender, DoWorkEventArgs e) {

//...

e.Result = true;

}

B. private void StartBackgroundProcess() {

bgwExecute.ProgressChanged += new ProgressChangedEventHandler(CompletedHandler);

ThreadStart tsBackground = new ThreadStart(WorkHandler);

bgwExecute.RunWorkerAsync(tsBackground);

}

void ProgressHandler(object sender, ProgressChangedEventArgs e) {

bool result = (bool)e.UserState;

MessageBox.Show("Update " + (result ? "was successful" : "failed"));

}

void WorkHandler() {

//...

bgwExecute.ReportProgress(100, true);

}

C. private void StartBackgroundProcess() {

bgwExecute.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompletedHandler);

ThreadStart tsBackground = new ThreadStart(WorkHandler);

bgwExecute.RunWorkerAsync(tsBackground);

}

void CompletedHandler(object sender, RunWorkerCompletedEventArgs e) {

bool result = (bool)e.Result;

MessageBox.Show("Update " + (result ? "was successful" : "failed"));

}

void WorkHandler() {

//...

e.Result = true;

}

D. private void StartBackgroundProcess() {

bgwExecute.DoWork += new DoWorkEventHandler(WorkHandler);

bgwExecute.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompletedHandler);

bgwExecute.RunWorkerAsync();

}

void CompletedHandler(object sender, RunWorkerCompletedEventArgs e) {

bool result = (bool)e.Result;

MessageBox.Show("Update " + (result ? "was successful" : "failed"));

}

void WorkHandler(object sender, DoWorkEventArgs e) {

//...

bgwExecute.ReportProgress(100, true);

}

Answer: A


70-526 training

Avant-garde 70-526 download:

Q6. You are creating a Windows Forms application. Initialization code loads a DataSet object named ds that includes a table named Users. The Users table includes a column named IsManager. You need to bind the IsManager column to the Checked property of a check box named chkIsManager. Which code segment should you use?

A. chkIsManager.DataBindings.Add("Checked", ds, "Users.IsManager");

B. chkIsManager.DataBindings.Add("Checked", ds, "IsManager");

C. chkIsManager.Text = "{Users.IsManager}";

chkIsManager.AutoCheck = true;

D. this.DataBindings.Add("chkIsManager.Checked", ds, "Users.IsManager");

Answer: A


Q7. A Windows Forms application loads an XmlDocument from a file named books.xml. You need to validate the XML against a schema that is contained in the books.xsd file when the XML loads. What should you do?

A. Associate the schema file with an XmlReader.Load the XmlDocument by using the XmlReader.

B. Add the schema to the Schemas property of the XmlDocument. Call the Load method of the XmlDocument by setting the filename parameter to books.xsd.

C. Call the Load method of the XmlDocument by setting the filename parameter to books.xsd, and then call the Load method by setting the filename parameter to books.xml.

D. Call the Load method of the XmlDocument by setting the filename parameter to books.xsd. Programmatically add the attribute xsi:schemaLocation to the root node. Set the value of this attribute to books.xsd.

Answer: A


Q8. You are creating a Windows Forms application that implements a master/detail form by using two DataGridView controls. You populate a dataset with a master table and a details table. You set the DataSource property of the master DataGridView control to the dataset. You set the DataMember property to the name of the master table. You also set the DataSource property of the details DataGridView control to the dataset. You need to ensure that the details DataGridView control displays only the child rows of the selected master row. What should you do?

A. Add a foreign key constraint to the dataset. Set the DataMember property of the child DataGridView control to the name of the foreign key constraint.

B. Define a data relation between the master table and details table in the dataset. Set the DataMember property of the child DataGridView to the name of the data relation.

C. Add a foreign key constraint to the dataset. Set the DataMember property of the child DataGridView control to the name of the details table.

D. Define a data relation between the master table and details table in the dataset.Bind the details DataGridView control to the dataset. Set the DataMember property of the child DataGridView control to the name of the details table.

Answer: B


Q9. A Windows Forms application contains the following code segment.

string SQL = @"SELECT EmployeeID, LastName, FirstName  FROM Employees";

SqlDataAdapter da = new SqlDataAdapter(SQL, connStr);

DataTable dt = new DataTable();

da.MissingSchemaAction = MissingSchemaAction.AddWithKey;

SqlCommandBuilder bld = new SqlCommandBuilder(da);

da.Fill(dt);

The application allows the user to add rows to the data table. The application will propagate these additions to the database. If the addition of any row fails, the other rows must still be added. The code must log how many new rows failed to be added. You need to propagate the additions to the database and log a failed count.  Which code segment should you use?

A. da.ContinueUpdateOnError = true;

da.Update(dt);

DataTable dtErrors = dt.GetChanges(DataRowState.Unchanged);

Trace.WriteLine(dtErrors.Rows.Count.ToString() + " rows not added.");

B. da.ContinueUpdateOnError = false;

da.Update(dt);

DataTable dtErrors = dt.GetChanges(DataRowState.Unchanged);

Trace.WriteLine(dtErrors.Rows.Count.ToString() + " rows not added.");

C. da.ContinueUpdateOnError = true;

da.Update(dt);

DataRow[] rows = dt.GetErrors();

Trace.WriteLine(rows.Length.ToString() + " rows not added.");

D. da.ContinueUpdateOnError = false;

da.Update(dt);

DataRow[] rows = dt.GetErrors();

Trace.WriteLine(rows.Length.ToString() + " rows not added.");

Answer: C


Q10. You are creating a Windows Forms application. Your application uses a custom control. The custom control is based on a standard Windows Forms Button control. You add several extra properties to the control. Some of these properties are read-only.  You need to ensure that the read-only properties are not displayed in the Properties window of the design environment. What should you do?

A. Decorate the read-only properties by using the EditorBrowsable attribute, and then set the EditorBrowsable attribute to EditorBrowsableState.Never.

B. Use the DesignTimeVisible attribute, and then set the DesignTimeVisible attribute to False.

C. Decorate the read-only properties by using the Browsable attribute, and then set the Browsable attribute to False.

D. Decorate the read-only properties by using the DisplayName attribute, and then set the DisplayName attribute to null.

Answer: C


70-526 vce

Verified 70-526 prep:

Q11. You are creating a Windows Form. You add a TableLayoutPanel control named pnlLayout to the form. You set the properties of pnlLayout so that it will resize with the form. You need to create a three-column layout that has fixed left and right columns. The fixed columns must each remain 50 pixels wide when the form is resized. The middle column must fill the remainder of the form width when the form is resized. You add the three columns in the designer. Which code segment should you use to format the columns at run time?

A. pnlLayout.ColumnStyles.Clear();

pnlLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));

pnlLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize, 100F));

pnlLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute,  50F));

B. pnlLayout.ColumnStyles[0].Width = 50F;

pnlLayout.ColumnStyles[0].SizeType = SizeType.Absolute;

pnlLayout.ColumnStyles[2].Width = 50F;

pnlLayout.ColumnStyles[2].SizeType = SizeType.Absolute;

C. pnlLayout.ColumnStyles[0].Width = 50F;

pnlLayout.ColumnStyles[0].SizeType = SizeType.Absolute;

pnlLayout.ColumnStyles[1].Width = 100F;

pnlLayout.ColumnStyles[1].SizeType = SizeType.AutoSize;

pnlLayout.ColumnStyles[2].Width = 50F;

pnlLayout.ColumnStyles[2].SizeType = SizeType.Absolute;

D. pnlLayout.ColumnStyles.Clear();

pnlLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));

pnlLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));

pnlLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));

Answer: D


Q12. You are creating a Windows Form that includes printing functionality to print an image of the form. A helper function with the following signature creates a bitmap of the current form.

private Bitmap CreateFormImageBitmap(Graphics graphic)

You need to implement the PrintPage event handler to call the helper function and draw the image onto the print document. Which code segment should you use?

A. Graphics g = e.Graphics;

Bitmap formImageBitmap = CreateFormImageBitmap(g);

e.Graphics.DrawImage(formImageBitmap, e.MarginBounds);

B. Graphics g = this.CreateGraphics();

Bitmap formImageBitmap = CreateFormImageBitmap(g);

g.DrawImage(formImageBitmap, g.ClipBounds);

g.Dispose();

C. Graphics g = this.CreateGraphics();

Bitmap formImageBitmap = CreateFormImageBitmap(e.Graphics);

g.DrawImage(formImageBitmap, g.ClipBounds);

g.Dispose();

D. Graphics g = this.CreateGraphics();

Bitmap formImageBitmap = CreateFormImageBitmap(g);

e.Graphics.DrawImage(formImageBitmap, e.MarginBounds);

g.Dispose();

Answer: D


Q13. You are creating a Windows Forms application. The application displays data from a Microsoft SQL Server 2005 database in a DataGridView control. The DataGridView control is populated by a data table. The data table is filled by using a SqlDataAdapter object. You need to display changes to the database as they happen without polling the database.  What should you do?

A. Create a SqlDependency object and bind it to a SqlCommand object that is used by the SqlDataAdapter object. Reload the dataset in an event handler that is registered for the OnChanged event of the SqlDendency object.

B. Use a TransactionScope block when calling the Fill method of the SqlDataAdapter object.

C. Set the CommandTimeout property of the SqlCommand object that is used by the SqlDataAdapter object to -1.

D. Reload the data table in an event handler that is registered for the RowChanging event of the DataTable object.

Answer: A


Q14. You are creating a Windows Forms application. The application loads a data table named dt from a database and modifies each value in the data table. You add the following code. (Line numbers are included for reference only.)

01 foreach (DataRow row in dt.Rows) {

02  foreach (DataColumn col in dt.Columns) {

03

04    Trace.WriteLine(str);

05  }

06 }

You need to format the string named str to show the value of the column at the time the data is loaded and the current value in the column. Which code segment should you add at line 03?

A. string str = String.Format("Column was {0} is now {1}", row[col], row[col, DataRowVersion.Current]);

B. string str = String.Format("Column was {0} is now {1}", row[col, DataRowVersion.Default], row[col]);

C. string str = String.Format("Column was {0} is now {1}", row[col], row[col, DataRowVersion.Proposed]);

D. string str = String.Format("Column was {0} is now {1}", row[col, DataRowVersion.Original], row[col]);

Answer: D


Q15. You are localizing a Windows Forms application. You put all error message strings into a resource file named ErrorMessages.resx. When the resource file is compiled, a strongly typed resource class is generated.  You need to retrieve an error message named CatastrophicErr from the exception-handling code. Which code segment should you use?

A. string s = ErrorMessages.CatastrophicErr;

B. string s = Properties.Settings.Default["ErrorMessages_CatastrophicErr"].ToString();

C. StringInfo si = new StringInfo("ErrorMessages.CatastrophicErr"); 

string s = si.String;

D. Assembly a = Assembly.GetExecutingAssembly();

Stream stream = a.GetManifestResourceStream("ErrorMessages.CatastrophicErr");

StreamReader sr = new StreamReader(stream);

string s = sr.ReadToEnd();

Answer: A



see more 70-526 - Microsoft .NET Framework 2.0 - Windows-based Client Development is in development