killtestの
Microsoft資格検定ベンーダ MCTS 70-526試験、気楽に試験を通します!killtestは70-526 (Microsoft .NET Framework 2.0 - Windows-based Client Development is in Development)問題集を提供し、無料ダウンロート、弊社は一年以内無料更新版のサービスを提供いたします、弊社の問題集は本格テストとすごく近いし、合格率は100%でございます!
試験番号: 70-
526
試験の名称: Microsoft .NET Framework 2.0 - Windows-based Client Development is in Development
1. 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
2. You are creating a Windows Forms application. The application executes a stored procedure that takes
several seconds to complete. The stored procedure is invoked to populate a SqlDataReader object. You
need to ensure that the application remains responsive to the user while the stored procedure is
executing. What should you do?
A. Use the SqlCommand.BeginExecuteReader method to call the stored procedure.Retrieve results by
using the EndExecuteReader method.
B. Use the SqlCommand.ExecuteReader method.Set the behavior parameter of this method to
CommandBehavior.SequentialAccess.
C. Create and bind a SqlDependency object to a SqlCommand object. Call the
SqlCommand.ExecuteReader method.Associate an OnChanged event handler with the SqlDependency
object. Gather results in the OnChanged event handler method.
D. Set the Notification property of a SqlCommand object to a SqlNotificationRequest object. Call the
SqlCommand.ExecuteReader method.Gather results on a background thread.
Answer: A
3. 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 settingthe 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 Loadmethod 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 theattribute xsi:schemaLocation to the root node. Set the value of this
attribute to books.xsd.
Answer: A
4. 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 thedatabase. If the addition of any row fails, the other rows must still be added. The code
must log how many new rowsfailed 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
5. You are creating a Windows Forms application. The application uses a SqlCommand object named
cmd. The cmdobject executes the following stored procedure. CREATE PROCEDURE GetPhoneList AS
BEGIN SELECT CompanyName, Phone FROM Customers SELECT CompanyName, Phone FROM
Suppliers END You need to add all returned rows to the ListBox control named lstPhones. Which code
segment should you use?
A. SqlDataReader rdr = cmd.ExecuteReader(); do { while (rdr.Read())
{ lstPhones.Items.Add(rdr.GetString(0) + "\t"+ rdr.GetString(1)); } } while (rdr.NextResult());
B. SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { lstPhones.Items.Add(rdr.GetString(0)
+ "\t" + rdr.GetString(1)); }
C. SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.NextResult()) { while (rdr.Read())
{ lstPhones.Items.Add(rdr.GetString(0) + "\t" + rdr.GetString(1)); } }
D. SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.NextResult())
{ lstPhones.Items.Add(rdr.GetString(0) + "\t" + rdr.GetString(1)); }
Answer: A
6. You are creating a Windows Forms application to retrieve and modify data. Depending on the
installation, the datasource can be a Microsoft Access database or a Microsoft SQL Server 2000 or later
database. You need to ensure thatyour application accesses data by automatically using the data
provider that is optimized for the data source. Whatshould you do?
A. Use the ODBC data provider classes.
B. Use the OLE DB data provider classes.
C. Use the SQL Server data provider classes.
D. Use the DbProviderFactory class and related classes.
Answer: D
7. A Windows Forms application reads the following XML file. <x:catalog
<book id="bk101"> <author>Gambardella, Matthew</author><title>XML
Developer's Guide</title> </book> <book id="bk102"> <author>Ralls, Kim</author> <title>Midnight
Rain</title> </book> </x:catalog> The form initialization loads this file into an XmlDocument object named
docBooks. You need to populate a ListBoxcontrol named lstBooks with the concatenated book ID and title
of each book. Which code segment should you use?
A. XmlNodeList elements = docBooks.GetElementsByTagName("book"); foreach (XmlElement node in
elements) { string s = node.GetAttribute("id") + " - "; s += node.SelectSingleNode("title").InnerText;
lstBooks.Items.Add(s); }
B. XmlNodeList elements = docBooks.GetElementsByTagName("book"); foreach (XmlElement node in
elements) { string s = node.SelectSingleNode("id") + " - ";s += node.GetAttribute("title");
lstBooks.Items.Add(s); }
C. XmlNodeList elements = docBooks.GetElementsByTagName("book"); foreach (XmlElement node in
elements) { string s = node.GetAttribute("id") + " - "; s += node.SelectSingleNode("title").Value;
lstBooks.Items.Add(s); }
D. XmlNodeList elements = docBooks.GetElementsByTagName("book"); foreach (XmlElement node in
elements) { lstBooks.Items.Add(node.InnerXml); }
Answer: A