Microsoft Certification 70-526 Practice Exam

38 Questions | Total Attempts: 1918

SettingsSettingsSettings
Microsoft Certification Exam Quizzes & Trivia

This is a practice exam for Microsoft Technology Specialist (TS) Exam 70-526 on the topic of Microsoft. NET Framework 2. 0 - Windows-based Client Development developed for students and learners. You can either take this as 70-526 practice questions or as a timed practice exam. Read the questions carefully. So, let's try out the quiz. All the best!


Questions and Answers
  • 1. 
    You create 4 forms FormA, FormB, FormC and FormD. You want to allow users to open FormA, FormB and FormC at the same time within FormD. Which properties do you need to set?
    • A. 

      IsMdiChild on Forms A,B and C; and IsMdiParent on FormD.

    • B. 

      MdiParent on Forms A,B and C; and IsMdiContainer on FormD.

    • C. 

      IsMdiChild on Forms A,B and C; and IsMdiContainer on FormD.

    • D. 

      MdiParent on Forms A,B and C; and IsMdiParent on FormD.

  • 2. 
    You create a custom control, which a user can drag and drop on his form. You want to create custom properties for your control, which the user can set using the Properties window of the Visual Studio IDE. What attribute can you use to control the visibility of the properties in the Properties window in the Visual Studio IDE?
    • A. 

      DebuggerBrowsable

    • B. 

      ComVisible

    • C. 

      Browsable

    • D. 

      DisplayBrowsable

  • 3. 
    You create a SqlCommand object �com� in order to execute a SQL Query on a database table. Which code snippet should you use in order to select all records from the table �Customers�?
    • A. 

      Com.CommandText = �SELECT * FROM Customers�; com.CommandType = CommandType.StoredProcedure;

    • B. 

      Com.CommandText = �SELECT * FROM Customers�; com.CommandType = CommandType.TableDirect;

    • C. 

      Com.CommandText = �Customers�; com.CommandType = CommandType.Text;

    • D. 

      Com.CommandText = �Customers�; com.CommandType = CommandType.TableDirect;

  • 4. 
    You have added a button named Bt1 to your form, whose Text is �Go�. You want to assign a shortcut to the button so that whenever a user presses ALT+G, the Click event of the button Bt1 is raised. What code should you use?
    • A. 

      Bt1.Text = @�Go�;

    • B. 

      Bt1.Text = �&Go�;

    • C. 

      Bt1.Text = �&&Go�;

    • D. 

      Bt1.Text = �@Go�;

  • 5. 
    Which property of the web browser control should you use in order to navigate to a specified URL?
    • A. 

      NavigateUrl

    • B. 

      DocumentUrl

    • C. 

      Url

    • D. 

      PageUrl

  • 6. 
    You are creating a setup and deployment project for your application. You want to ensure that the .NET Framework 2.0 is installed on the computers of the users who want to install your application. Which deployment editor should you use?
    • A. 

      Registry Editor

    • B. 

      File System Editor

    • C. 

      Launch Conditions Editor

    • D. 

      Required Components Editor

  • 7. 
    You add a PictureBox control to your form, in order to display images to the user. Usually, you see that the images are smaller in size than the PictureBox control. What value of the SizeMode property should you set so that the size of the images adjust to fill the PictureBox control?
    • A. 

      Normal

    • B. 

      StretchImage

    • C. 

      ExpandImage

    • D. 

      AutoSizeImage

  • 8. 
    You use a TransactionScope in your application in your application in order to use transaction semantics. What code should you use in order to commit the transaction within the transaction scope?
    • A. 

      TransactionScope.Completed = true;

    • B. 

      TransactionScope.Commit();

    • C. 

      TransactionScope.Complete();

    • D. 

      TransactionScope.IsCompleted = true;

  • 9. 
    You decide to use named parameters in a SqlCommand object in order to execute SQL queries on a database. You have a parameter named CustomerName. How do you refer to it within the SQL query text in the SqlCommand object?
    • A. 

      ?CustomerName

    • B. 

      %CustomerName

    • C. 

      @CustomerName

    • D. 

      #CustomerName

  • 10. 
    Which function of the SqlCommand object must you use in order to execute an �INSERT� SQL Query?
    • A. 

      ExecuteScalar();

    • B. 

      ExecuteNonQuery();

    • C. 

      ExecuteReader();

    • D. 

      ExecuteCommand();

  • 11. 
    You have a textbox control on your form. You want to store some custom data associated with that object. This data should not be visible to the user it is meant for internal use in your application. What code should you use?
    • A. 

      Use the Text property.

    • B. 

      Use the Tag property.

    • C. 

      Use the UserInfo property.

    • D. 

      Use the CustomData property.

  • 12. 
    You want to create a reusable control by combining existing Windows Controls in order to use it in various of your applications. What should the base class of your control be?
    • A. 

      System.Windows.Forms.UserControl

    • B. 

      System.Windows.Forms.Control

    • C. 

      System.Windows.Forms.WindowsControl

    • D. 

      System.Windows.Forms.Component

  • 13. 
    You have a textbox Text1 and an ErrorProvider ep1 on your form. You want to display an error message on your form when invalid data in Text1 is entered. What code should you use?
    • A. 

      Text1.SetError(�invalid data�, ep1);

    • B. 

      Text1.SetError(ep1, �invalid data�);

    • C. 

      Ep1.SetError(Text1, �invalid data�);

    • D. 

      Ep1.SetError(�invalid data�, Text1);

  • 14. 
    You create a function F, which will be executed in a separate thread. You create a thread object T, and use a ParameterizedThreadStart delegate passing in F, so that when the thread starts, F will get executed. What should the signature of the function F be?
    • A. 

      Void return type, no parameter

    • B. 

      Object return type, no parameter

    • C. 

      Void return type, object parameter

    • D. 

      Object return type, object parameter

  • 15. 
    You want to create an XmlDocument object in order to read XML data stored in a file �input.xml�. Which code should you use?
    • A. 

      XmlDocument doc = new XmlDocument("input.xml");

    • B. 

      XmlDocument doc = new XmlDocument(); doc.Load("input.xml");

    • C. 

      XmlDocument doc = new XmlDocument(); doc.Open("input.xml");

    • D. 

      XmlDocument doc = new XmlDocument(); doc.File = "input.xml";

  • 16. 
    You want to access websites on the internet using HTTP. Which of the classes below can you use?
    • A. 

      System.Net.WebClient

    • B. 

      System.Net.HttpClient

    • C. 

      Sytem.Net.InetClient

    • D. 

      System.Net.HttpWebRequest

    • E. 

      System.Net.IPClient

  • 17. 
    You create a function named �ThreadedFunction� which you will execute in a new Thread. To this function, you will pass the name of a file, and in the function, you will read the contents of that file. What code should you use to start the thread?
    • A. 

      Thread T = new Thread(new ThreadStart("ThreadedFunction")); T.Start(filename);

    • B. 

      Thread T = new Thread(new ThreadStart("ThreadedFunction", filename)); T.Start();

    • C. 

      Thread T = new Thread(new ParameterizedThreadStart("ThreadedFunction")); T.Start(filename);

    • D. 

      Thread T = new Thread(new ParameterizedThreadStart("ThreadedFunction", filename)); T.Start();

  • 18. 
    You have a DataSet object ds1, which contains two tables � �Orders� and �OrderDetails�. The OrderId column in Orders is set to a DataColumn object called to, and the same column in the OrderDetails table is set to a DataColumn object called DCOI. Since this is a foreign key relationship, you want to capture this relationship in the dataset. What code would you use to link these two tables in the DataSet ds1?
    • A. 

      DataRelation dr = new DataRelation("relationname", dcoi, dco); ds1.Relations.Add(dr);

    • B. 

      DataRelation dr = new DataRelation("relationname", dco, dcoi); ds1.Relations.Add(dr);

    • C. 

      DataRelation dr = new DataRelation("relationname", dcoi, dco); ds1.Relations.Add("relationname");

    • D. 

      DataRelation dr = new DataRelation("relationname", dco, dcoi); ds1.Relations.Add("relationname");

  • 19. 
    You have a .xml file and the corresponding .xsd. Which class should you use to validate the XML against the corresponding schema file?
    • A. 

      XmlValidatingReader

    • B. 

      XmlDictionaryReader

    • C. 

      XmlReader

    • D. 

      XmlSchemaReader

  • 20. 
    You dynamically create a TextBox control tb1 in code at runtime. You want to associate an event handler with tb1 that gets fired when the user clicks tb1. What operator will you use to associate the event handling function with the Click event of tb1?
    • A. 

      &=

    • B. 

      =

    • C. 

      +=

    • D. 

      |=

  • 21. 
    You use a DataTable to load data from the Orders Table from a database. The Orders table contains two columns of � Quantity and UnitPrice. You want to add another column, which computes the total price using the formula: TotalPrice=Quantity*UnitPrice. What code will you use to add this third column to the DataTable?
    • A. 

      DataTable.Columns.Add("TotalPrice", typeof(Double), "Quantity" * "UnitPrice");

    • B. 

      DataTable.Columns.Add("TotalPrice", typeof(Double), Quantity * UnitPrice);

    • C. 

      DataTable.Columns.Add("TotalPrice", typeof(Double), "Quantity * UnitPrice");

    • D. 

      DataTable.Columns.Add("TotalPrice", typeof(Double), "Quantity", "UnitPrice");

  • 22. 
    You want to make your application accessible to physically challenged users. Consider Windows Narrator. When controls receive focus, the Narrator speaks out the information given to it. Which properties does the Narrator speak out for a windows control?
    • A. 

      Name

    • B. 

      AccessibleName

    • C. 

      Description

    • D. 

      AccessibleDescription

    • E. 

      AccessibleRole

  • 23. 
    When the user moves the mouse cursor over a Button control, you want to change the background colour of the button. When the user moves the mouse away from the Button, you want to restore the original background color of the Button. What events do you need to use?
    • A. 

      MouseOver and MouseOut

    • B. 

      MouseHover and MouseOut

    • C. 

      MouseOver and MouseLeave

    • D. 

      MouseHover and MouseLeave

  • 24. 
    You have a DataTable in your application which you display to the user. The user is allowed to enter some data in a textbox and then press the Update button to update the data in the data table. You want to add code to an event of the DataTable so that when a Row is being updated, a message box is displayed to the user. Which event of the DataTable should you use?
    • A. 

      RowUpdating

    • B. 

      RowUpdated

    • C. 

      RowChanging

    • D. 

      RowChanged

  • 25. 
    You execute a number of SQL Queries on an SQLConnection object �conn�, in the context of a SqlTransaction �trans�. In your code, you have logic that aborts the transaction in some cases. What code would you use to abort the transaction so that the changes don�t get committed to the database?
    • A. 

      Trans.Abort();

    • B. 

      Conn.AbortTransaction();

    • C. 

      Trans.Rollback();

    • D. 

      Conn.RollbackTransaction();

Related Topics
Back to Top Back to top