Microsoft C#.NET Exam 70-320 Short Notes & Tips

Creating and Managing Microsoft Windows Services, Serviced Components, .NET Remoting Objects, and XML Web Services

  • The SessionID property of the HttpSessionState class identifies an active ASP.NET session by using a unique session ID.
  • The Process.Start method is used to start a Windows application and is registered in the system registry on a computer.
  • A constructor is used to create an object that is an instance of a class. It has the same name as the class in which it resides.
  • A sealed class is a class that cannot be derived from. Sealed classes are primarily used to prevent unintended derivation.
  • If a class derives from the ServiceBase class, the OnCustomCommand method is executed when the Service Control Manager (SCM) passes a custom command to the service. This method is used to specify actions when a command with the specified parameter value occurs.
  • The AutoLog property of the ServiceBase class is used to determine whether or not a service automatically logs the entries in the event log when events such as Start, Stop, Pause, and Continue occur.
  • The ServiceController class represents a Windows service. It is used to connect to a Windows service, manipulate it, and get information about it.
  • The Status property of the ServiceController class specifies the status of the current instance of a Windows service.
  • The OnStart method of a Windows service is used to specify the processing that occurs when a Windows service receives the Start command.
  • A namespace allows developers to organize and uniquely qualify element names and relationships defined in an assembly.
  • When an object reference is prefixed with the name of the namespace where it is defined, it is known as the fully qualified name of the object. Since the fully qualified names can be long, they can be used by defining aliases for them.
  • When declaring an array in Visual C# .NET, only the upper bound of the array is defined. Arrays in Visual C# .NET are always zero-based, i.e., the lower bound is always zero.
  • The CreateEventSource method of the EventLog class establishes an application as a valid event source for writing event information to a particular event log on a computer.
  • The Installutil tool is used to install a Windows application. The .NET class library provides some predefined installer classes that helps in application installation.
  • As soon as a computer’s power status changes, the Service Control Manager or SCM of a Windows service verifies whether the service accepts power event commands.
  • When the CanHandlePowerEvent property is set to true, the power event command is passed to the service and the OnPowerEvent method is called.
  • The Assembly Registration (Regasm.exe) tool is used to read the metadata within an assembly. It also adds the necessary entries to the registry allowing a COM client to create .NET Framework classes. Once a class is registered using Regasm.exe, a COM client can use it as a COM component.
  • Strong name is a name consisting of an assembly’s identity, public key, and digital signature. It includes the assembly’s name, version number, and other related information (if any).
  • A publisher policy configuration file contains compatibility information issued by the publisher of a shared component.
  • The EditCommand event of the DataGrid control occurs when users click the Edit button for a DataGrid item.
  • The EditItemIndex property of the DataGrid control specifies the index of an item in the DataGrid control to edit. It is used to programmatically control which item is being edited.
  • The .NET Framework allows sharing of an assembly among multiple applications. Such an assembly is called shared assembly. All assemblies stored in global assembly cache must have strong names.
  • The Strong Name (Sn.exe) tool is used to sign assemblies with strong names. It also provides signature generation, signature verification, and key management.
  • The serviced component in a COM application is hosted by assigning a strong name to the assembly, registering the assembly in the Windows registry, and registering and installing the type library definitions in a COM application.
  • The class interface exposes public properties, methods, fields, and events that are explicitly exposed on a .NET object. It is not explicitly defined in managed code. However, it has the same name as that of the .NET class, preceded by an underscore.
  • The ComVisible attribute specifies whether or not a class or interface is visible in COM.
  • A component is first signed with a strong name and then is installed in the global assembly cache.
  • The ServicedComponent class that is the base class of those classes that use COM services. It is defined in the System.EnterpriseServices namespace.
  • A serviced component uses component services of COM , such as object pooling, transaction management, etc.
  • While processing a transaction, the Aborted state occurs when the transaction fails due to unsuccessful execution of a task.
  • The InterfaceQueuing attribute is used when message queuing is done at the component level. COM calls client requests on the components that are to be recorded and stored in the queue even when the server component is unavailable.
  • During the Manual registration, the assembly fails to load error type occurs due to which the error message that describes the reason for the failure is displayed as output.
  • The AutoComplete attribute of System.EnterpriseServices namespace applies to the methods of the serviced component class.
  • The StrongNameIdentityPermissionAttribute class is used to allow security actions to be applied to code using declarative security.
  • The PublicKey property of the StrongNameIdentityPermissionAttribute class specifies the public key value of the strong name identity and is expressed as a hexadecimal string.
  • The Just-in-Time (JIT) activation service is used to minimize the amount of time for which an object is created and consumes resources and services on the server. With JIT activation, a client can hold a reference for an object on the server.
  • The Sn.exe tool is used to sign a portable executable file for a component or an assembly with an Authenticode digital signature.
  • The following are the advantages of early binding:
    1. Objects are created faster.
    2. Information about properties and methods of the object is available in design environment.
  • The @ Register directive is used to associate aliases with namespaces and classes.
  • The BeginReceive method of the MessageQueue class initiates an asynchronous operation and a MessageQueue object begins receiving a message and notifies the ReceiveCompleted event handler when the operation is finished.
  • The EndReceive method of the MessageQueue class is called when the ReceiveCompleted event is raised. The method completes the specified asynchronous operation received by the MessageQueue object.
  • The HttpChannel class is used to provide an implementation for a sender-receiver channel that uses the HTTP protocol for transmitting messages.
  • The SoapFormatter class is used to serialize and deserialize an object in SOAP format.
  • Server-activated objects (SAOs) are remote objects whose lifetime is controlled by the server. These objects can be activated as SingleCall or Singleton objects.
  • A SingleCall object is created for each client request.
  • A Singleton object is created once on the server and shared by all clients.
  • The SerializableAttribute attribute specifies whether or not a class can be serialized.
  • Client-activated objects (CAOs) are objects that are created whenever a client requests for a remote object to be created.
  • The System.Runtime.Remoting namespace is used to provide classes and interfaces that create and configure distributed applications.
  • The System.Runtime.Remoting.Channels.Tcp namespace consists of channels that use the TCP protocol for transmission of messages and objects to and from remote locations.
  • The <wellknown> element is used to specify that a remoting object is a server-activated object.
  • The <channel> element specifies that an application configures the channel through which it communicates with remote objects. A new channel that is not a channel template can also be declared and configured.
  • SOAP is an XML-based protocol and defines rules for data encoding.
  • The SoapUnknownHeader class is used to handle data received from a SOAP header but not understood by any recipient Web service.
  • While defining and processing SOAP headers, a class representing data in a particular SOAP header needs to be defined. The class must be derived from the SoapHeader class.
  • The <types> section of the WSDL file defines data types and data structures used by a Web service.
  • The Session object is used to create a variable that will be available as long as the session is active.
  • Web Services Description Language (Wsdl.exe) is a tool used to generate code for XML Web services and Web service clients from WSDL, XSD schema files, and discovery documents.
  • The Peek method of the StreamReader class returns an integer type value to determine whether or not the end of the file or an error has occurred. It returns value -1 if no characters are available on the stream or the end of file has reached.
  • XML Web service is a programmable entity providing a particular element of functionality, such as application logic.
  • The HTTP-GET, HTTP-POST, and HTTP-SOAP protocols are used to test the WebService application from a Web browser by using ASP .NET.
  • The HTTP-GET and HTTP-POST protocols are the standard Web protocols that send parameters as name-value pairs to an XML Web service.
  • XML Web services can be used internally or externally over the Internet by employing Internet standard protocols that include XML, SOAP, XSD, and WSDL.
  • The MemberName property of the SoapHeaderAttribute class specifies the member of the XML Web service that represents the SOAP header contents.
  • The MessageName property of the WebMethod attribute is used to give an alias name to an XML Web service method. It is generally used to uniquely identify overloaded Web methods.
  • The SoapException exception is thrown when an XML Web service method is called over SOAP. It is thrown by the common language runtime or an XML Web service method.
  • An XML Web service is a programmable entity providing a particular element of functionality, such as application logic.
  • The Description property of the WebMethod attribute is used to specify a descriptive message for an XML Web service method. It accepts a string as an input value.
  • The CacheDuration property of the WebMethod attribute is used to specify the number of seconds for which the response should be held in the cache.
  • The Namespace property of the WebService attribute specifies the namespace of a proxy generated by Visual Studio .NET 2005.
  • Use the BufferResponse property of the WebMethod attribute to serialize the Web method response into a memory buffer until the response is completely serialized, which is returned back to the Web service clients over the network.
  • The EnableSession property of the WebMethodAttribute class is used to enable session state for an XML Web service method.
  • The [WebMethod(TransactionOption = TransactionOption.RequiresNew)] statement indicates that an XML Web service method requires a new transaction. Whenever any request is made and processed, an XML Web service is created within a new transaction.
  • The DiscoveryDocumentReference class is used to discover the available XML Web services as given by a URL. The URL must point to the discovery document that has the .disco file extension.
  • An array of data containing a user’s session is created and the Session object is used for data storage. If the Session object is enabled, only users of a particular session will be redirected to other Web pages to view them.
  • The TcpChannel, TcpClientChannel, and TcpServerChannel classes are used to authenticate as well as to encrypt data for secure data communication.
  • The RateOfCountsPerSecond32 value for PerformanceCounterType is used to display the average number of operations completed every second.
  • A XML Web service is used to open wire formats to communicate between different systems.
  • Open wire formats are the protocols that support common Web standards, such as HTTP and SOAP.
  • The Regsvr32.exe tool is used to register or unregister dynamic-link libraries (DLLs) and ActiveX controls (OCX) in the Windows Registry.

Consuming and Manipulating Data

  • An attribute name must begin with a letter or an underscore. A string value assigned to an attribute is delimited using either single quotes or double quotes.
  • The DataSet and DataRelation objects are used to create a relationship between these two databases to retrieve records.
  • When data tables are fetched from the databases they must be stored in the DataSet. Datagrid is used to show the data tables on the application form.
  • The OleDbConnection class represents an open connection to an OLE DB data source, a Microsoft SQL Server 6.x database, or earlier version.
  • The OleDbCommand class represents a stored procedure or a SQL statement to execute at a data source.
  • The Min Pool Size value of the ConnectionString property is used to specify the minimum number of connections allowed in a pool.
  • The ExecuteScalar method of the SqlCommand class is used to execute a query. It retrieves the first column of the first row in a result set.
  • A connection string is modified to use the same login ID and password for all connections to a database. This will enable the application to use a single connection pool.
  • The NextResult method of the SqlDataReader class is used to process multiple results that are generated by executing a stored procedure.
  • The Fill method of the DbDataAdapter class is used to add rows in a DataSet to match those in a data source.
  • The Add method of the DataRelationCollection class adds a DataRelation object to the collection of DataRelation objects in a DataSet.
  • The ContinueUpdateOnError property of the SqlDataAdapter class gets or sets a value that specifies whether to generate an exception, or the row in error when an error is encountered during a row update.
  • The Precision property of the SqlParameter class is used to get or set the maximum number of digits that are used to represent the Value property.
  • Setting the SET ROWCOUNT command in a Transact-SQL statement will cause the query to stop processing when a certain number of rows are to be retrieved and when data modification statements such as INSERT, UPDATE, and DELETE are written in an application.
  • The RowStateFilter property of the DataView class is used to filter rows based on their state, such as ModifiedCurrent, ModifiedOriginal, CurrentRows, etc. Users can get data from multiple versions by using the boolean OR operator with the RowStateFilter property.
  • The DataViewRowState.ModifiedCurrent value for the RowStateFilter property is used to display the modified version of the original data.
  • The Sort property of the DataView class specifies the sort column names. Column names are specified in the Sort property followed by ASC (for ascending order) or DESC (for descending order). However, columns are sorted in ascending order by default.
  • The ExecuteNonQuery method of the SqlCommand class is used to execute commands that change a database. These commands include the Transact-SQL INSERT, UPDATE, DELETE, and SET statements.
  • The AcceptChanges method of the DataTable class commits all changes made to a table since the AcceptChanges method was last called.
  • The ConnectionString property of the SqlConnection class is used to connect to a data source.
  • The Data Source attribute of the ConnectionString property specifies the name or the network address of the server instance to which a connection is to be established.
  • The Initial Catalog attribute of the ConnectionString property specifies the name of the database.
  • The OleDbDataAdapter class is used to represent a database connection and a set of data commands that are used to fill the DataSet and update the data source. It is used as a bridge between a DataSet and data source to save and retrieve data.
  • The EnableViewState property of a DataGrid control specifies whether or not the server control maintains its own view state and the view states of its child controls. By setting this property to false will improve the performance of the application, as it will disable the view states.
  • The LoadDataRow method of the DataTable class finds the matching value and updates a specific row in the primary column of a specific table. If the value does not match, a new row is created.
  • The SqlConnection class represents an open connection to a Microsoft SQL Server. It is used to represent a unique session to a Microsoft SQL Server 7.x database or later.
  • The ApplyDefaultSort property of the DataView object is used to automatically sort data, in ascending order, based on the primary key column(s) of a table. This property applies to a table only when the table has a primary key defined and the Sort property of the DataView object is set to a null reference or an empty string.
  • The RepeatDirection property of the CheckBoxList control specifies a value indicating whether or not the control displays items vertically or horizontally.
  • The Select method of the DataTable class gets an array of DataRow objects. The parameter provided in this method specifies the criteria on the basis of which the rows are retrieved from the DataTable object.
  • The SelectedItem property of the ListControl retrieves a selected item having the lowest index in the list control.
  • The SqlParameter constructor accepts two parameters, the parameter name and its datatype. Once the SqlParameter object is created, its direction is specified.
  • The Cache object implements the cache for a Web application.
  • The Session object pertains to an individual user’s session with an application. It is used to store and retrieve information during a specific session for a user.
  • The Find method of the DataView object is used to find a row in a DataView object on the basis of the specified sort key value.
  • The XmlNode class is used to represent a single node in the XML document.
  • The OuterXml property of the XmlNode class is used to retrieve the markup representing an XML node and its children nodes.
  • The DataRelation class is used to relate two DataTable objects to each other through DataColumn objects.
  • The OleDbConnection class represents an open connection to a data source. It is used to represent a unique session to an OLE DB data source, or to a Microsoft SQL Server 6.x database or earlier.
  • The OleDbCommand class represents a stored procedure or a SQL statement to execute at a data source.
  • The ExecuteScalar method of the SqlCommand class is commonly used to execute aggregate functions such as COUNT, SUM, etc., on a table.
  • The Close method of the SqlConnection class closes the connection to the database. This method can be called more than once by an application.
  • The Finalize method of the SqlConnection class performs cleanup operations before the object is reclaimed by garbage collection. There is no guarantee of the resources being released at a particular time, unless the Dispose or Close method is called.
  • The CommandText property of the OleDbCommand class is used to get or set the stored procedure or SQL statement that is to be executed at the data source.
  • The Connection property of the OleDbCommand class is used to get or set the OleDbConnection that is used by an instance of the OleDbCommand class.
  • The SqlParameter constructor accepts two parameters, i.e., parameter name and its datatype.
  • The DataBindings property of the TextBox control is used to bind the control with the data source.
  • By setting the CommandType property of the SqlCommand class to StoredProcedure causes the command to be interpreted as the name of the stored procedure rather than a SQL statement. The default value of this property is CommandType.Text.
  • The DataBind method of the BaseDataList class binds a control and all its child controls to the data source that is specified by the DataSource property.
  • The Direction property of the SqlParameter class is used to get or set a value, which indicates the type of a parameter. A parameter can be input-only, output-only, bi-directional, or a stored procedure return value parameter.
  • A stored procedure is a group of Transact-SQL statements compiled into a single execution plan. It provides better performance, as a fully compiled execution plan is created and retained in the SQL Server procedure cache.
  • The Read method of the SqlDataReader class advances the SqlDataReader object to the next record if the next record exists. It returns true if another record exists. Otherwise, it returns false.
  • The SQL Server database version 6.5 can be upgraded to later version in order to improve performance of program code.
  • The GROUP BY clause groups selected rows on the basis of values of specified column or columns for each row and returns a single row of summary information for each group. It does not guarantee the order of the result set. Therefore, an ORDER BY clause should be used with the GROUP BY clause to sort the result set in the desired order.
  • A stored procedure is a group of Transact-SQL statements compiled into a single execution plan. It can be used to implement business logic or as a security mechanism, but it is not executed automatically.
  • The inner join produces only the matching rows from both the tables.
  • The ReadXml method of the DataSet class reads XML schema and data into a DataSet.
  • The DataReader class is used to retrieve a read-only and forward-only stream of data. It optimizes the performance of an application because only one row at a time remains in the memory.
  • SQL Server 2000 supports the FOR XML clause with the SELECT statement. The FOR XML clause instructs the SELECT statement to return the query result in an XML format instead of a tabular format.
  • The DataBind method of the Page class binds a data source to the invoked server control and all its child controls.
  • The FileIOPermission class is used to control the ability to access files and folders.
  • The PermitOnly method of the FileIOPermission class is used to prevent callers higher in the call stack from using the code that calls a method to access resources that are not specified by the current instance.
  • The Parameters.Add method adds a SqlParameter object to the SqlParameterCollection.
  • The SqlCommand class represents a Transact-SQL statement or stored procedure to be executed at a SQL Server database.
  • The ExecuteScalar method of the SqlCommand class is used to execute query commands that return a single value, such as an average, from a data source irrespective of the number of rows actually selected.
  • The XmlNode class is used to represent a single node in the XML document.
  • The OuterXml property of the XmlNode class is used to retrieve the markup representing an XML node and its children nodes.
  • The Merge method of the DataSet class is used to incorporate the latest changes from a data source into an existing DataSet object.
  • The RowFilter property of the DataView class is used to get or set the expression to filter the rows to be viewed in a DataView object.
  • The expression for the RowFilter property includes a column name defined in a database table, an operator, and a value to filter on.
  • The Read method of the SqlDataReader class advances the data reader to the next result. It returns true if there are more results to be returned, otherwise it returns false.
  • The Prepare method of the SqlCommand class is used to create a prepared version of the command on an instance of SQL Server. This method prepares a compiled version of the command on the data source.
  • The CommandType property specifies how the command string is interpreted. The SqlParameter class represents a parameter to a SqlCommand object. The SqlParameter constructor accepts two parameters, parameter name and its datatype.
  • In a DataSet object that contains multiple DataTable objects, a DataRelation object is used to create a relationship between two tables. This relationship exists only within the context of the DataSet object.
  • The Add method of the DataRelationCollection class adds a DataRelation object to the collection of DataRelation objects in a DataSet.
  • The Clone method of the DataSet class copies only the schema of a DataSet object.
  • The ExecuteNonQuery method of the SqlCommand class returns an integer value, which indicates the number of rows affected as a result of the execution of a SQL statement.
  • The Find method of the DataRelationCollection class is used to get a specified row from a collection of DataRow objects.
  • The SqlDataAdapter(QueryString1, conn) constructor initializes a new instance of the SqlDataAdapter class with a SQL query string variable and a SqlConnection object. This constructor requires a minimum amount of code.
  • The ConnectionTimeout property of the System.EnterpriseServices namespace is used to represent a connection to a datasource. This property should be used for an application to respond quickly in a few seconds.
  • The SqlConnection class represents an open connection to a SQL Server database.
  • ADO.NET supports connection pooling where the SqlConnection class is used to increase the performance of the application.
  • The SqlConnection.BeginTransaction method starts a database transaction.
  • The SqlTransaction.Connection property returns a SqlConnection object in association with a transaction that can take place for each new database connection.
  • In AssessmentText.Text = (string)comm.Parameters[“”@AssessmentResult””].Value; statement, the Value property of the SqlCommand class is used to retrieve the value of a specified output parameter. The (string) typecast in the code segment ensures that the value of the output parameter is a string before assigning its value to the Text property of the AssessmentText text box control.
  • The inner join is used to retrieve records from two tables that are combined and added to a query’s result set. The result can be retrieved only when the values of the joined fields meet a specified criteria.
  • The XmlDocument class represents the top node of an XML document.
  • The XmlReader class defines properties that are used to retrieve information about the name and content of the current node.
  • XML Schema Definition tool (Xsd.exe) converts data formats into XML schemas and vice versa.
  • The System.Threading namespace provides interfaces and classes that enable multithreaded programming in XML.
  • The LineNumber property that is inherited from the XmlSchemaObject class, specifies the line number referred to by a schema element in a file.
  • An XML document must have only one top-level element known as document element or root element. Each element must have both a start tag and an end tag.
  • An XML document consists of two main parts, namely prolog and document.
  • The Namespace property of the DataSet class is used to specify the namespace of a DataSet object.
  • The Regsvcs.exe tool is used to load and register assemblies as well as generate, register, and install a type library into a COM application.
  • The DeleteRule property of the ForeignKeyConstraint class is used to specify the action that is to occur when a row is deleted.
  • To normalize data and apply indexes on the tables in a database is to improve the application’s performance.
  • The XPathDocument class is used to provide fast and read-only cache for XSLT processing and XPath data model.
  • The OnItemDataBound method of the DataGrid control is used to raise the ItemDataBound event that occurs after a data item is bound to the control.
  • The Load method of the XmlDocument class is used to load the contents of an XML file into an XmlDocument object.
  • The AutoGenerateColumns property is used to get or set a value that indicates whether or not the BoundColumns object are automatically created and displayed in the DataGrid control for each field in a data source.
  • The Update method of the DataAdapter class is used to call an INSERT, DELETE, or UPDATE statement for each inserted, deleted, or updated row in a DataSet from a DataTable.
  • DiffGram is an XmlWriteMode value and it specifies that a DataSet has to be written as a DiffGram containing current and original values.
  • The Expression property of the DataColumn class creates an aggregate column. It can be used to calculate values in a column or filter records.
  • The DataRowState value that is stored in the RowState property of the DataRow class, specifies whether the DataRow object is added, deleted, detached, modified, or unchanged.
  • The XmlDocument class is used to create an in-memory tree object containing an XML hierarchical node structure and related data. It loads and saves an XML document and accesses all the nodes in the document.
  • The Relations property of the DataSet class specifies the collection of data relations that links two or more tables.
  • The BeginLoadData method of the DataSet class is used to turn off all notification, constraints, and index maintenance while data is loaded.
  • The EndLoadData method of the DataSet class is used to turn on all notification, constraints, and index maintenance after data is loaded.
  • The SqlDataReader class avoids creating unnecessary objects or making unnecessary copies of data. Hence, it provides optimal performance.
  • The Procedure property of the SqlError class is used to return the name of the stored procedure or Remote Procedure Call (RPC) from which an error has generated.
  • The xsi:noNamespaceSchemaLocation attribute is an XML schema instancing (XSI) attribute that is used when an XML document needs to be validated.
  • The xsi:schemaLocation attribute is another attribute that can be used to validate contents in an XML file.
  • The <codeBase> element is used only in machine configuration file or in publisher policy file. This element is also used to redirect the assembly version.
  • The <probing> element is used in the application configuration file in order to specify subdirectories in which the common language runtime searches for an assembly.
  • The PermitOnly method of the FileIOPermissionAccess class is used to prevent callers higher in the call stack from using the code that calls this method to access resources that are not specified by the current instance.
  • Web Services Description Language (Wsdl.exe) is a tool used to generate code for XML Web services and Web service clients from WSDL, XSD schema files, and discovery documents.
  • The xml data type is a built-in data type in SQL Server 2005. As with other built-in data types such as int and varchar, a user can define the xml data type on a column when he creates a table.
  • The XmlNode class derived from the System.Xml namespace is a representation of a single node in an XML document. It is the base class in the XML DOM and supports XPath selections and provides editing capabilities.
  • The FOR XML AUTO clause is used with the SELECT statement to return a query result as an XML document. This clause forces SQL Server to generate XML documents automatically using defaults.
  • The XMLDATA clause is used to retrieve XML datatype information.
  • The Select method of the XPathNavigator class is used to select the set of nodes and returns an object of the XPathNodeIterator class.
  • The Compile method of the XPathNavigator class is used to compile a string that represents an XPath expression.
  • The Transform method of the XslTransform class is used to transform XML data using an XSLT, and returns the results into a Stream.
  • The Response.OutputStream argument is used to enable the output to the outgoing HTTP response stream.
  • The proper approach to synchronize a DataSet object with an XmlDataDocument object is to first populate the DataSet object with data and then to synchronize it with the XmlDataDocument object.
  • The InferSchema value of the XmlReadMode enumeration is used to ignore an inline schema, infer schema from data, and load the data. If a DataSet object already contains a schema, the schema is extended by adding new tables or columns to the tables.
  • The GetChanges method of the DataSet class returns a copy of the DataSet, containing all changes made to the DataSet since it was last loaded, or since the AcceptChanges method was last called.
  • The Commit, Rollback, and Save methods are defined in the SqlTransaction class.
  • The Save method of the XmlDocument class is used to save an XML document to a specified file or location.
  • The XmlNode class derived from the System.Xml namespace is a representation of a single node in an XML document. It is the base class in the XML DOM, and supports XPath selections and provides editing capabilities.
  • The WriteXml(string, XmlWriteMode) method of the DataSet class is used to write XML schema and data from a DataSet object in XML format.
  • The EditCommand event of the DataGrid control occurs when users click the Edit button for a DataGrid item.
  • The EditItemIndex property of the DataGrid control specifies the index of an item in the DataGrid control to edit. It is used to programmatically control which item is being edited.
  • The args.Item.ItemIndex statement specifies the index of the selected item in the DataGrid control.
  • The ItemDataBound event is raised after an item is data bound to a DataGrid control.
  • The Load method of the XmlDocument class is used to load the contents of an XML file into an XmlDocument object. It always preserves significant white space. It does not perform document type definition (DTD) or schema validation.
  • The XmlDocument class that defines within the System.Xml namespace is used to represent an XML document.
  • The Clone method of the DataSet class clones the DataSet structure containing DataTable schemas, constraints, and relations. It does not copy data from a DataSet object.
  • A constructor of the DataRelation class is used to create a DataRelation object that represents the parent/child relationship between two tables. This DataRelation object is then passed as a parameter to the Add method, which adds the object to the data relation collection of the DataSet.
  • The ImportNode method of the XmlDocument class is used to import the node from another XML document.
  • The WriteXmlSchema method of the DataSet class creates an XML Schema Definition (XSD) file from the DataSet object. This method writes the DataSet structure as an XML Schema.
  • The <xs:key> element specifies that the field or column on which a key constraint is specified must have unique values and must contain no null values.
  • The <unique> element specifies that a value of an attribute or element must be unique within the specified scope.
  • The name attribute of the <unique> element defines the name of the unique element and must be unique within an identity constraint set.
  • An XmlReader class is created to display the XML file from a database. The Read method is implemented in order to read data from the XML file.
  • The GetErrors method of the DataTable class returns an array of DataRow objects that have errors.
  • The HasErrors property of the DataTable class returns a value that specifies whether any error exists in any rows of the data table.
  • The AutoIncrement property of the DataColumn class sets a value to indicate whether or not the value of the column is automatically incremented for new rows to be added to the table.
  • The AutoIncrementSeed property sets the starting value for a column only if the AutoIncrement property is set to true.
  • The AutoIncrementStep property of the DataColumn class sets the number by which the value of the column is to be automatically incremented. The default value of this property is 1.
  • The Connection Timeout parameter of the ConnectionString property specifies the time period (in seconds) required to wait for a connection to the server.
  • The Max Pool Size parameter of the ConnectionString property determines the maximum number of connections allowed in a connection pool.
  • The IDataAdapter interface allows an object to implement the DataAdapter class.
  • The AllowDBNull property of the DataColumn class returns a value to indicate whether null values are allowed in the column to retrieve specified data records.
  • Left outer join produces all records from the left table with the matching records from the joined table.

Testing and Debugging

  • When an application is developed, it is required to ensure that the application is defect free and fulfills the requirements for which it was developed. Therefore, developers perform various levels of testing on an application.
  • During unit testing, a developer takes the smallest unit of an application, isolates it from the rest of the application code, and tests it to determine whether it gives the desired results.
  • The following are the advantages of Unit testing:
    1. A large percentage of defects can be identified during the process of Unit testing.
    2. It enhances the process of testing, as the elementary units of an application are tested separately.
    3. It reduces the cost of testing, as small special programs such as test drivers and stubs can be reused during the whole process of testing.
    4. It also simplifies the process of debugging, as it limits the search for errors to a small unit of the application, instead of searching the whole of the application.
  • The Regression testing is used to make sure that no new errors are found in an application. It can be performed any time when a program needs to be modified either to add a feature or to fix an error.
  • Testing a software aims at fulfilling each and every requirement specified in the software specification.
  • A test plan can be defined as a formal document that guarantees that the software has been tested thoroughly, meets user requirements, and has no defects.
  • The WriteLineIf method is used to write information to the trace listeners with a new line character if a condition is true.
  • A try block must be accompanied by at least one catch block or one finally block.
  • The Assert method of the Trace class checks for a condition and displays a message if the condition is false.
  • The EventLogTraceListener class provides a listener that directs debugging or tracing output to an EventLog.
  • The TraceSwitch class provides a multilevel switch to control trace and debug output. It does not require recompiling the code. It can be used to specify whether or not tracing occurs in the application code.
  • The <trace> element of the application’s Web.config file is used to ensure that the trace output is appended to the bottom of each page.
  • The <customErrors> element of the Web.config file provides information about custom error messages for ASP.NET applications.
  • The mode attribute of the <customErrors> element is used to specify whether custom errors are enabled, disabled, or shown only to remote clients.
  • The EventLog class is used to interact with Windows event logs.
  • The Source property of the EventLog class is used to specify the source name to register and use when writing to the event log.
  • A client-activated .NET Remoting object is created to ensure that an object logs error and warning messages to a log file and Windows application log.
  • The Trace.axd Http handler is used to view the trace details of an application by setting the value of requestLimit=””[n]”” in the application’s configuration file.
  • The Assert method of the Trace class is used to check for a condition and displays a message if the condition is false.
  • The Fail method of the Trace class emits an error message unconditionally.
  • The TraceError property of the TraceSwitch class returns true if Level is set to Error, Warning, Info, or Verbose; otherwise it returns false.
  • The TraceWarning property of the TraceSwitch class returns true if Level is set to Warning, Info, or Verbose; otherwise it returns false.
  • The pageOutput attribute sets the value to true if the trace information is displayed both on an application’s pages and in the .axd trace utility, otherwise it sets the value to false. It specifies whether or not trace output is rendered at the end of each page of an application.
  • The WriteLineIf method of the Debug class is used to write a message with a new line character to the trace listeners in the Listeners collection if a condition is true.
  • The requestLimit attribute specifies the number of trace requests to be stored on the server. The trace is automatically disabled if the limit is reached.
  • A breakpoint is used while debugging an application. It specifies a line in a method or sub procedure at which Visual Studio .NET automatically suspends execution.
  • The Cordbg.exe and DbgCLR.exe tools are used to debug .NET applications.
  • When a debugger is attached to a running service, the current functioning of the Web service will be interrupted. As soon as the debugger starts its debugging, the service does not stop or pause its processing. Instead, the service is still in its start mode when the application is debugged, but the service process has actually been suspended.
  • The Configuration property generates a program database file (.pdb) that contains information about symbols used within the application on compiling the project. It also lets breakpoints invoke on debugging.
  • In order to debug a Windows service, first of all it is started and then a debugger is added to the process in which the service is running.
  • The Al.exe tool is used to compile .resources files into satellite assemblies.
  • In order to create a satellite assembly from .resx and .resources files, first of all convert the .resx file to a .resources file by using the Resgen.exe tool. Secondly, these two .resources files are then compiled into a satellite assembly by using the Al.exe tool.
  • The Watch window is used to see the values of variables within different scopes, i.e., module level, procedure level, and global variables.
  • In order to resolve the issue of the logical error that had occurred in the Web form, the program is executed step-by-step to get the exact location of the error. Breakpoints are used in the code to analyze why the code is generating errors.
  • The Data breakpoint breaks the execution of a program and causes the program to change the value of a variable available in the source code of an application.
  • The Cordbg.exe tool is used to debug an application from a command prompt. It provides command-line debugging services. It also helps to find and fix bugs in programs that target the .NET Framework common language runtime.
  • The Locals window is a debugging window and its contents change to reflect only the variables applicable to the current procedure. Global variables and variables in other projects are not accessible from the Locals window.
  • The Watch window is a debugging window that displays the current watch expressions, whose values are to be monitored, as the code runs. This window can display a value for a watch expression only if the current statement is in the specified context.
  • When a debugger is attached to an XML Web service, a call from a calling code can time out indicating that the debugging process cannot be continued. As a result, an error message will be raised along with an exception of the type ‘System.Net.WebException’. To resolve this issue, the timeout value for the XML Web service call should be set to infinite, i.e., to -1.
  • The ErrorProvider control is used to provide a user interface for indicating whether or not a control has an error associated with it.
  • The SetError method of the ErrorProvider control is used to specify the error description string for a specified control.
  • The Output debugging window is used to display status messages at runtime. Its content is cleared each time the application is compiled or run.
  • The Call Stack debugging window displays a list of currently active procedure calls during break mode.
  • The CreateEventSource method of the EventLog class creates an event if the event log does not already exist and register a Web service with this event log.

Deploying Windows Services, Serviced Components, .NET Remoting Objects, and XML Web Services

  • The .NET Framework Services Installation (Regsvcs.exe) tool is used to manually register an assembly containing a serviced component.
  • Manual registration is used for design-time testing to find out the types of errors that may occur at runtime.
  • In dynamic registration, an assembly with a serviced component is copied into the COM application’s directory. Dynamic registration is used only when a managed client creates a serviced component.
  • Programmatic registration is used to register an assembly, containing a serviced component, programmatically by creating an instance of the RegistrationHelper class.
  • Registering a serviced component either using manual registration, dynamic registration, or programmatic registration.
  • If a Web service is inaccessible from the computer or network on which it is installed, the Web Services Description Language (Wsdl.exe) tool can be used to create the proxy class manually. This proxy class file is then added to the application project.
  • The following are the various features of .NET deployment:
    1. By default, multiple applications do not share components.
    2. Multiple applications need to explicitly make the components available for sharing by assigning a strong name to an assembly.
    3. No-impact applications isolate an application and remove DLL conflicts.
    4. Private components have no impact on other applications.
    5. Side-by-side versioning deploys multiple versions of a component or an application.
  • The <requiredRuntime> tag is used in the configuration file of an application to specify the version of a common language runtime used to execute an application.
  • Debugger (Cordbg.exe) is a tool that provides command-line debugging services. It uses runtime Debug API to debug managed code.
  • The Launch Condition tab in the Project Properties dialog box is used to specify conditions for installation. These conditions can be used in conjunction with a file, registry, or component search.
  • The User Interface Editor is used to view and edit user interface dialog boxes that are displayed during the application installation on the target computer.
  • The ToString method of the Exception class provides the maximum information about the exception.
  • The Installutil.exe tool can be used to install multiple assemblies at a time. It performs installation in a transactional manner.
  • The Resgen.exe tool can be used to perform the following tasks:
    1. Convert .txt files to .resources or .resx files.
    2. Convert .resx files to .txt or .resources files.
    3. Convert .resources files to .txt or .resx files.
  • The Windows Explorer allows installation and uninstallation of assemblies in the Global Assembly Cache by using drag and drop and menu operations.
  • Web service discovery is a preliminary process for accessing a Web site. It locates Web service descriptions.
  • Through the discovery process, Web service clients know about the existence of a Web service, its capabilities, and how to interact with it.
  • In order to publish an XML Web service on the intranet, the Web service is registered in the private UDDI registry, and the discovery (disco) document is built for the XML Web service.
  • A Web service can be deployed on a Web server by copying the files manually on the Web server, using the Copy Project command of Visual Studio .NET, and by using the Windows Installer package.
  • The Rollback method of the Installer class is used to restore back to the pre-installation state when it is overridden in a derived class. It is called only when the Install method call fails to run correctly or is unsuccessful.
  • In order to deploy a Windows service on different computers, the Setup Project template is used to install the Windows service in a directory of the file system, and it is also registered by using the Windows Service Control Manager during installation.
  • The FileMajorPart property of the FileVersionInfo class returns the major part of the version number of a file.
  • Publisher policy is a set of rules, which enables vendors to establish compatibility among different versions of an assembly or a shared component. It can be used to redirect assembly references from one version to another, and to deploy service packs such as updates of an assembly or a shared component.
  • For deploying shared assemblies, the binding policy that is a set of rules determines the place to search for the assembly and version to bind to the application. The searching process of the CLR involves the following three stages of the binding policy resolution:
    1. Application policy resolution
    2. Publisher policy resolution
    3. Administrator policy resolution
  • The CLR determines the correct version of an assembly by examining the application configuration file, the publisher policy file, and the machine configuration file.
  • The following are the different approaches on how the correct version of an assembly is specified in the assembly manifest:
    1. Include the AssemblyVersion attribute in an application’s source code.
    2. Update the AssemblyVersion attribute in the AssemblyInfo file of an application.
    3. Include the System.Reflection namespace in the project when the AssemblyVersion attribute is included in the application’s source code.
  • The Web application directory, WebService.asmx file, and Web.config file are the components of Web service and are published on the Web while deploying an XML Web service.
  • The Common Language Runtime finds the assembly through the codebase setting. If it does not find any match in the <codebase> element in the application configuration file, the binding request fails. Then the CLR tries to find the assembly through probing.
  • The Mscorcfg.msc or the .NET Framework Configuration tool configures and manages assemblies in the global assembly cache. It also handles security policies such as code access security policy.
  • The <authentication> tag is used to configure ASP.NET authentication support.
  • Basic authentication is used to authenticate users on the Internet and enables a browser to prompt the user for a username and password.
  • Authorization determines whether or not a principal is allowed to perform a requested action.
  • Declarative security check is a security check performed on the declarative information in metadata. It uses attributes to place security information into the metadata of application code.
  • Imperative security check is a security check that occurs on calling a security method within the code being protected. It works by instantiating security classes and using them directly. It can be isolated within an object or method.
  • The FileAuthorizationModule module is used when the authentication mode attribute is set to Windows in the authentication element and checks against the access control list (ACL).
  • The GenericPrincipal class represents a generic principal. The GenericIdentity class represents a generic identity. Both GenericPrincipal and GenericIdentity classes are used in conjunction with each other to create an authorization scheme.
  • The GenericPrincipal and GenericIdentity classes can be used to prompt users for their user names and passwords, to check these values against a database, and to create principal and identity objects.
  • The UrlAuthorizationModule class of the System.Web.Security namespace is used to provide URL-based authorization services to allow or deny access to specified resources.
  • The WebResponse class derived from the System.Net namespace is used to provide a response from a Uniform Resource Identifier (URI).
  • The WebRequest class derived from the System.Net namespace is used to make a request to a Uniform Resource Identifier (URI).
  • Basic authentication requires remote users to use a valid Windows NT account name and password to access the Web server.
  • The SoapHeaderAttribute class is used to specify a SOAP header so that the Web methods that implement this class are able to process data passed to the SOAP header.
  • Integrated Windows authentication is a method of authentication that uses the security features of Windows clients and servers. It is more secure than Basic or Digest authentication. It relies on Internet Explorer and does not work over HTTP proxies.
  • The Server Application of the COM application is used to provide high level security to the component.
  • The ComponentAccessControl, ApplicationAccessControl, SecureMethod, and SecurityRole attributes can be implemented in a component for configuring security.
  • The principal object of the IPrincipal interface is used during the authentication process. It contains information about a user’s identity such as username and password and a user’s role such as manager or associate.
  • The <authorization> element is used to configure ASP.NET authorization support.
  • The IsSubSetOf method of the PrincipalPermission class is used to determine whether or not the current permission object is a subset of the specified permission object.
  • The PrincipalPermissionAttribute attribute applies to a class or method in order to declaratively demand for those users who belong to a specified role or have been authenticated.
  • The Union method of the PrincipalPermission class is used to create a permission object that is the union of the current permission object and a target parameter permission object.
  • The SecurityAction.RequestOptional value requests for additional and optional permissions of the assembly.
  • The SecurityRole attribute of the assembly element is used to allow the COM security configuration for the library or server application.
  • In the Packet Privacy authentication level, authentication and encryption of data are performed. This level includes data integrity and the identity and signature of a user.
  • Anonymous authentication method establishes a Web connection to the IIS server without providing a username and password.
  • The Microsoft Passport service is an online service that is used by the Passport authentication provider for user authentication. The passport to indicate authenticated users uses an encrypted mechanism.
  • Digest authentication is a secure authentication method in which passwords are sent across a network as a hash value, rather than as clear text.
  • The Custom Authentication with SOAP headers is suitable for both secure and nonsecure Internet scenarios. For user authentication, the user credentials in encrypted format are passed within the SOAP header of the SOAP message.
  • Authentication is a process of verifying the identity of a person, network host, or system process.
  • The Windows authentication provider authenticates users on the basis of their Windows accounts.
  • The generic role-based security is used to secure data from unauthorized users.

2 Replies to “Microsoft C#.NET Exam 70-320 Short Notes & Tips”

  1. Pingback: www.buzzflash.net
  2. Pingback: designfloat.com

Comments are closed.