Seleziona l'iniziale:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
> Clicca qui per scaricare l'elenco completo delle domande di questo argomento in formato Word!
What should you do? Add the Serializable attribute to the BankCustomer class.
What should you do? Derive the BankCustomer class from MarshalByRefObject. Override the inherited InitializeLifetimeService method to return null.
Dealer is configured to use Integrated Windows authentication to authenticate its callers. You must ensure that all users of SaveSales are members of the Manager group before allowing the code within SaveSales to run.
Which code segment should you use? [PrincipalPermission(SecurityAction.Demand, Role=â€Managerâ€)] public DataSet SaveSales(DataSet sales) { // Code to save sales data goes here. }
You must ensure that remote client applications are securely authenticated prior to gaining access to Payroll object. You want to accomplish this task by writing the minimum amount of code.
What should you do? Host the Payroll class in Internet Information Services (IIS) and implement Integrated Windows authentication.
A variety of remote client applications will communicate with PropertyCache to set and get property values. You need to ensure that properties set by one client application are also accessible to other client applications.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two) Configure PropertyCache to be a server-activated Singleton object.
A variety of remote client applications will communicate with PropertyCache to set and get property values. You need to ensure that properties set by one client application are also accessible to other client applications.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two) Derive the PropertyCache class from MarshalByRefObject and override InitializeLifetimeService() to return null.
Which code segment should you use? Trace.Listeners.Add(new EventLogTraceListener(“objâ€)); Trace.Listeners.Add( new TextWriterTraceListener(“obj.logâ€)); Trace.WriteLine(“sample messageâ€);
You anticipate that there will be future updates to Component that you will provide to your customers. All updates to Component will be backward compatible. You will create similar setup projects for each update of Component that will register the updated assembly in the global assembly cache.
You need to ensure that any applications on your customers’ computer that reference Component use the most recent version of the component.
Which action or actions should you take? (Choose all that apply) Sign Component by using a strong name.
You anticipate that there will be future updates to Component that you will provide to your customers. All updates to Component will be backward compatible. You will create similar setup projects for each update of Component that will register the updated assembly in the global assembly cache.
You need to ensure that any applications on your customers’ computer that reference Component use the most recent version of the component.
Which action or actions should you take? (Choose all that apply) Include a publisher policy file that is registered in the global assembly cache on your customer’s computers.
You anticipate that there will be future updates to Component that you will provide to your customers. All updates to Component will be backward compatible. You will create similar setup projects for each update of Component that will register the updated assembly in the global assembly cache.
You need to ensure that any applications on your customers’ computer that reference Component use the most recent version of the component.
Which action or actions should you take? (Choose all that apply) Increment the assembly version for each update of Component.
Additional serviced components written by other developers will continuously update the inventory data as orders are placed.
The ItemInventory class includes the following code segment: <Transaction(TransactionOption.Required)> _ Public Class ItemInventory Inherits ServicedComponent ‘ Method code goes here. End Class
ItemInventory is configured to require transactions. You want ItemInventory to respond to requests as quickly as possible, even if that means displaying inventory values that are not up to date with the most recent orders.
What should you do? To the ItemInventory class, add the following attribute: <ObjectPooling(True)>
Additional serviced components written by other developers will continuously update the inventory data as orders are placed.
The ItemInventory class includes the following code segment: <Transaction(TransactionOption.Required)> _ Public Class ItemInventory Inherits ServicedComponent ‘ Method code goes here. End Class
ItemInventory is configured to require transactions. You want ItemInventory to respond to requests as quickly as possible, even if that means displaying inventory values that are not up to date with the most recent orders.
What should you do? Modify the Transaction attribute of the ItemInventory class to be the following attribute: <Transaction(TransactionOption.Required, _ IsolationLevel:= TransactionIsolationLevel.ReadUncommitted)>
The UserManager class includes the following code segment: [Transaction(TransactionOption.Required)] [SecurityRole(“Adminâ€)] public class UserManager : ServicedComponent { public void AddUser(string name, string password) { // Code to add the user to data sources goes here. } }
You must ensure that the AddUser method reliably saves the new user to either all data sources or no data sources.
What should you do? To AddUser, add the following attribute: [AutoComplete()]
What should you do? First sign the assembly by using a strong name. Then sign the assembly by using File Signing tool (Signcoe.exe).
You need to ensure that Form creates an instance of TheirObject to make the necessary remote object calls.
Which code segment should you use? RemotingConfiguration.RegisterActivatedClientType(typeof(TheirObject), “http://Server/TheirAppPath/TheirObject.remâ€); TheirObject theirObject = new TheirObject();
You need to ensure that Form creates an instance of TheirObject to make the necessary remote object calls.
Which code segment should you use? RemotingConfiguration.RegisterWellKnownClientType(typeof(Object); “http://Server/TheirAppPath/TheirObject.remâ€); TheirObject theirObject = new TheirObject();
UserService consists of a Web method named RetrieveUserInfo. This Web method takes a userID as input and returns a DataSet object containing user information. If the userID is not between the values 1 and 1000, a System ArgumentException is thrown.
In WebApp, you write a try/catch block to capture any exceptions that are thrown by UserService. You invoke RetrieveUserInfo and pass 1001 as the user ID.
Which type of exception will be caught? System.Web.Service.Protocols.SoapException
You need to design GetAccountBalance to receive encrypted user credentials by using two custom fields named Username and Password in the SOAP header. To accomplish this goal, you must write the code for GetAccountBalance.
Which code segment should you use? public class AuthenticateUser : SoapHeader { public string Username; public string Password; } // In the AccountInformation class add this code: public AuthenticateUser authenticateUserHeader; [WebMethod, SoapHeader(“authenticateUserHeaderâ€)] public string GetAccountBalance() { if (authenticateUserHeader == null) return “Please supply credentials. “; else // Code to authenticate user and return // the account balance goes here. }
You configure ApproveService to use only Integrated Windows authentication. You must ensure that access to specific functionality within the service is based on a user’s membership in specific Windows groups. You want to accomplish this by using rolebased security.
You want to allow all members of the Reviewers group and of the Admins group to be able to execute the Close method without creating a third group that contains members from both groups.
Which code segment should you use? [PrincipalPermissionAttribute (SecurityAction.Demand, Role=â€Reviewersâ€)] [PrincipalPermissionAttribute (SecurityAction.Demand, Role=â€Adminsâ€)] private void Close() { // Code to process the Close method goes here. }
On test computers, you want to see error messages and warning messages. On deployment computers, you want to see error messages, but not warning messages.
Which two code segments should you use (Each correct answer presents part of the solution.)? (Choose two) private static TraceSwitch mySwitch; static BankCustomer { mySwitch = new TraceSwitch(“tswitchâ€, “a trace switchâ€); }
On test computers, you want to see error messages and warning messages. On deployment computers, you want to see error messages, but not warning messages.
Which two code segments should you use (Each correct answer presents part of the solution.)? (Choose two) Trace.WriteLineIf(mySwitch.TraceError, “An error occurred.â€); Trace.WriteLineIf(mySwitch.TraceWarning, “Warning messageâ€);
InventoryService exposes a Web method named RetrieveInventory that returns inventory information to the caller. You configure Internet Information Services (IIS) and InventoryService to use Integrated Windows authentication.
You need to write code in InventoryService to ensure that only members of the Manager group can access RetrieveInventory.
What should you do? To the <authorization> section of the Web.config file, add the following element: <allow roles=â€Manager†/>
You need to ensure that callers of InventoryService are authenticated based on their Windows logon name and password. You configure Internet Information Services (IIS) according to your security needs. You need to configure the authentication type in the Web.config file.
Which code segment should you use? <authentication mode=â€Windows†/>
You need to ensure that these messages cannot be intercepted and viewed by anyone other than LegalService and the custondrs who access LegalService.
Which security mechanism should you use? SSL
ListBoxService contains a Web method named RetrieveRegionsListBox. This method runs a DataSet object that contains every geographical region in the world. RetrieveRegionsListBox calls a Microsoft SQL Server database to load the DataSet object with region data. You want to minimize the amount of time the method takes to return to the caller.
What should you do? Set the CacheDuration property of the WebMethod attribute to an interval greater than zero.
You want to implement security for WriteMessage so that WriteMessage and all the code it calls can write messages only to the myServiceLog directory.
Which code segment should you use? FileIOPermission filePermission = new FileIOPermission (FileIOPermissionAccess.Write, “C:\\Logs\myServiceLogâ€); filePermission.PermitOnly();
Once callers are authenticated, you want to use Windows user accounts to authorize access to the Web methods exposed by the Web service. You set up two Windows user accounts named FultonAssociate and FultonManager. You need to configure myWebService to meet these security requirements.
Which type of authentication should you use? Client Certificate
You know that callers who consume this service will require that SOAP messages be formatted as document-literal SOAP messages or RPC-encoded SOAP messages. You must create a solution that will return both types of SOAP messages.
You want to accomplish this task by writing the minimum amount of code.
Which code segment should you use? [SoapDocumentMethod()][WebMethod()] public string BuyStockDoc(string symbol, int shares) [SoapRpcMethod()][WebMethod()] public string BuyStockRpc(string symbol, int shares)
RetrieveStockInfo takes as input a stock symbol and returns a DataSet object that contains information about that stock. You want to capture all incoming SOAP messages in RetrieveStockInfo and write the messages to a file for future processing.
What should you do? Create a SOAP extension for RetrieveStockInfo.
Which code segment should you use? CounterCreationData[] counterData = { new CounterCreationData( “OrderStatus req/secâ€, “helpâ€, PerformanceCounterType.RateOfCountsPerSecond32) }; CounterCreationDataCollection collection = new CounterCreationDataCollection(counterData); PerformanceCounterCategory.Create(“Trackerâ€, “Tracker performance countersâ€, collection);
You need to write code to ensure that once the caller is authenticated, a user identity named Generic is created. This user identity has membership in a group named Shipping to allow access to ViewShippingDetail.
Which code segment should you use? GenericIdentity myIdentity = new GenericIdentity(“Genericâ€, “Customâ€); string[] Roles = {“Shippingâ€}; GenericPrincipal myPrincipal = new GenericPrincipal(myIdentity, Roles); Thread.CurrentPrincipal = myPrincipal;
For testing, you create an ASP.NET application named WeatherTest. To WeatherTest, you add a Web reference to WeatherService. You then build a user interface and add the necessary code to test the service.
The WeatherService interface will not change between testing and deployment. You want to ensure that you do not have to recompile WeatherTest every time WeatherService is moved from one server to another.
What should you do? Set the URLBehavior property of the generated proxy class to dynamic. Each time WeatherService is moved, update the appropriate key in the Web.config file to indicate the new location.
What should you do? Create a GenericIdentity object and a GenericPrincipal object. Then implement imperative role-based security.
You must ensure that client credentials passed to the service are secure and cannot be compromised. You are not as concerned with the length of time that Web method calls take to maintain this level of security. You need to configure authentication for this service.
Which type of authentication should you use? Client Certificate
You create a SOAP extension and override the extension’s ProcessMessage method so that you can encrypt the message before it is sent back to the caller.
You need to encrypt only the data within the RetrieveMessageResult node of the SOAP response. You create a function named EncryptMessage that encrypts the RetrieveMessageResult node. You need to ensure that this method gets called before sending the message back to the caller.
During which SoapMessageStage should you call EncryptMessage? AfterSerialize
A Web method named GetQuotes takes a languageID as input. GetQuotes uses this language ID to retrieve a translated version of the daily quotation from a Microsoft SQL Server database and to return that quotation to the customer.
You want to minimize the time it takes to return the translated version.
What should you do? Store each translated quotation by using the Cache object.
A Web method named GetQuotes takes a languageID as input. GetQuotes uses this language ID to retrieve a translated version of the daily quotation from a Microsoft SQL Server database and to return that quotation to the customer.
You want to minimize the time it takes to return the translated version.
What should you do? Set the CacheDuration property of the WebMethod attribute to an interval greater than zero.
RetrieveEmployees takes a roleID as input that specifies the type of employee to retrieve, either Manager or Engineer. RetrieveEmployees returns an array type Employee that contains all employees that are in the specified role.
You want to ensure that Manager and Engineer object types can be returned from RetrieveEmployees.
What should you do? Apply two XmlInclude attributes to RetrieveEmployees, one of type Manager and one of type Engineer.
The service will use a standard encryption routine to encrypt the data before it is sent to the caller. The caller will decrypt the data by using instructions provided by you.
You need to write code to encrypt the sensitive data that is in a local variable named myData. First, you create an instance of a Cryptography Service Provider.
What should you do next? Create an Encryptor object that passes in a key and an initialization vector (IV) as parameters. Create a CryptoStream object that passes in an output stream and the Encryptor object as parameters. Convert myData to a stream and use the CryptoStream object to write the value of myData to an encrypted stream. Convert the output stream to a string.
When serialized by the XMLSerializer, stock will take the following form: <Stock symbol=â€> <Company /> <CurrentPrice /> </Stock>
You need to construct the Stock class.
Which code segment should you use? Public Class Stock <XmlAttributeAttribute(“symbolâ€)>_ Public Symbol As String <XmlElementAttribute(“Companyâ€)>_ Public CompanyName As String Public CurrentPrice As Double End Class
You decide to transform the XML code and its declaration into a string for easy inspection.
What should you do? Assign the outerXml property of the Xml document object to a string variable
You decide to transform the XML code and its declaration into a string for easy inspection.
What should you do? Assign the outerXml property of the Xml document element property of the Xml document object to a string variable.
Customer has a primary key of customerID. Each row in orders has a CustomerID that indicates which customer placed the order.
Your application uses a DataSet object named ordersDataSet to capture customer and order information before it applied to the database. The ordersDataSet object has two Data Table objects named Customers and Orders.
You want to ensure that a row cannot exist in the Orders Data Table object without a matching row existing in the customers Data Table object.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two.) Create a foreign key constraint named ConstraintCustomers that has Customers.CustomerID as the parent column and Orders.CustomerID as the child column.
Customer has a primary key of customerID. Each row in orders has a CustomerID that indicates which customer placed the order.
Your application uses a DataSet object named ordersDataSet to capture customer and order information before it applied to the database. The ordersDataSet object has two Data Table objects named Customers and Orders.
You want to ensure that a row cannot exist in the Orders Data Table object without a matching row existing in the customers Data Table object.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two.) Add ConstraintCustomers to the Orders Data Table.
int CalculateValue(int x) ;
CalculateValue is located in an unmanaged DLL named Functions.dll, and is not part of a COM interface. You need to be able to use CalculateValue in your application.
Which action or actions should you take? (Choose all that apply) To your application, add the following code segment: [DllImport(“Functions.dllâ€)] public static extern int CalculateValue(int x);
CalculateValue is located in an unmanaged DLL named Functions.dll, and is not part of a COM interface. You need to be able to use CalculateValue in your application. Your project directory contains a copy of Functions.dll.
While you are working in Debug mode, you attempt to run your application. However, a System.DllNotFoundException is thrown. You verify that you are using the correct function named. You also verify that the code in the DLL exposes CalculateValue. You have not modified the project assembly, and you have not modified machine-level security. You need to test your application immediately.
What should you do? Move Functions.dll to your project’s Debug directory.
One function requires the calling application to allocate unmanaged memory, fill it with data, and pass the address of the memory to the function. On returning from the function, the calling application must deallocate the unmanaged memory.
You need to decide how your application will handle unmanaged memory.
What should you do? Use the methods of the Marshal class.
The query must retrieve all rows and all columns from a database table named Customers.
Which query should you use? SELECT * FROM Customers FOR XML AUTO
You must iterate the query results and populate an HTML table with product information.
You must ensure that your application processes the results as quickly as possible.
What should you do? Set the SqlCommand object’s CommandText to sqlQuery. Use the ExecuteXmlReader method of the SqlCommand object to create an XmlReader object. Use the XmlReader object to read the data.
The application must validate all incoming XML data. It uses an XmlValidatingReader object to read each XML document. If any invalid sections of XML are encountered, the inconsistencies are listed in a single document.
You must ensure that the validation process runs as quickly as possible.
What should you do? Create and register a ValidationEventHandler method.
You want to populate the list box with data from a DataSet object. You want to fill the DataSet object by using a SqlDataAdapter object.
You create a SqlConnection object named Connection and a SQL query string named regionSQL. You need to write the code to create the SqlDataAdapter object.
Which code segment should you use? SqlDataAdapter DataAdapter = new SqlDataAdapter(regionSQL, Connection);
Your application invokes a Web method named CustomerUpdates in an XML Web service. This method accepts DataSet as a parameter and processes the updates made in the DataGrid object.
You want to ensure that network traffic to the Web service is minimized.
Which code segment should you use? if (DataSet.HasChanges()) { DataSet customerChanges = new DataSet(); customerChanges = DataSet.GetChanges(); CustomerUpdates(customerChanges); }
You create a method named GeneratePurchaseRequest. You write the code to populate a DataSet object named myDataSet with the purchase request data. You define a variable named fileName that contains the name and path of the output file.
You need to create an XML file from the data in myDataSet by adding code to GeneratePurchaseRequest. You want to accomplish this task by writing the minimum amount of code.
Which code segment should you use? myDataSet.WriteXML(fileName, XmlWriteMode.IgnoreSchema);
AccountInformation also exposes a public class named AuthenticateUser.
AuthenticateUser has two properties named Username and Password that are both defined as string.
In the application, you create two local variables named encryptedUsername and encryptedPassword that you will use to pass user credentials to GetAccountBalance.
You need to write code that will execute the GetAccountBalance Web method.
Which code segment should you use? AccountInformation AccountInformation = new AccountInformation(); AuthenticateUser AuthenticateUser = new AuthenticateUser(); AuthenticateUser.Username = encryptedUsername; AuthenticateUser.Password = encryptedPassword; AccountInformation.AuthenticateUserValue = AuthenticateUser; string accountBalance; accountBalance = AccountInformation.GetAccountBalance();
Which two actions should you take (Each correct answer presents part of the solution)? (Choose two) Create an XSD schema that defines DataSet.
Which two actions should you take (Each correct answer presents part of the solution)? (Choose two) Create a class for DataSet that is based on the schema and that inherits from the DataSet class.
You need to maximize the security on the deployment computer. You want to configure the component’s COM+ application to run under a restricted user account named OutsideUser.
What should you do? Use the Component Services tool to manually set the Identity property of the COM+ application to OutsideUser.
You use Visual Studio .NET to create a setup project. You need to install InventoryService. You also need to run a script to create the necessary SQL Server database and tables to store the data. To accomplish this, you need to configure the project to have administrator rights to the SQL Server database.
You add a custom dialog box to the project that prompts the user for the administrator user name and password that are used to connect to the SQL Server database. You need to make the user name and password available to a custom Installer class that will execute the script.
What should you do? Create a custom install action. Set the CustomActionData property to the entered user name and password. Then access these values in the Install subroutine.
XmlTextWriter xwriter = new XmlTextWriter(“productNames.xmlâ€, System.Text.Encoding.UTF8); xwriter.WriteStartDocument(true); xwriter.WriteStartElement(“dataâ€); string val = NextToken(); while(val ! = “â€){ xwriter.WriteElementString(“itemâ€, val); val = NextToken(); } xwriter.WriteEndElement(); xwriter.WriteEndDocument(); xwriter.Close();
You find that productsNames.xml contains only two entries: prod0 and prod1.
Which XML output is produced by this code segment? <?xml version=â€1.0â€?> <data xmlns=â€> <item = “prod0†/> <item = “prod1†/> </data>
XmlTextWriter xwriter = new XmlTextWriter(“productNames.xmlâ€, System.Text.Encoding.UTF8); xwriter.WriteStartDocument(true); xwriter.WriteStartElement(“dataâ€); string val = NextToken(); while(val ! = “â€){ xwriter.WriteElementString(“itemâ€, val); val = NextToken(); } xwriter.WriteEndElement(); xwriter.WriteEndDocument(); xwriter.Close();
You find that productsNames.xml contains only two entries: prod0 and prod1.
Which XML output is produced by this code segment? <?xml version=â€1.0†encoding=â€utf-8†standalone=â€yesâ€?> <data xmlns=> <item>prod0</item> <item>prod1</item> </data>
input = “A string with 6 words and 2 numbers†words = null numbers = null Parse(input, words, numbers)
After execution, words contains all string words found in input and numbers contains all integers found in input. You need to enable your application to call this function.
Which code segment should you use? [DllImport(“Functions.dllâ€)] public static extern void Parse(string input, ref string[] words, ref int[] numbers);
What should you do? Run the Type Library Importer (Tlbimp.exe) with the /namespace and /out options to create the assembly.
What should you do? Use Visual Studio .NET to add a reference to the COM component.
Which code segment should you use? [DllImport(“Functions.dllâ€)] public static extern int encrypt(string input, StringBuilder output); string input = “Stuff to encryptâ€; StringBuilder output = new StringBuilder(500); int errCode = encrypt(input, output);
Which code segment should you use? [DllImport(“Functions.dllâ€)] public static extern int encrypt(string input, ref string output); string input = “stuff to encryptâ€; string output = null; int errCode = encrypt(input, ref output);
The class included the following code segment: [Com Visible(false)] public class Class { public Class() { // Implementation code goes here. } [ComVisible(true)] public int Method(string param) { return 0; } [ComVisible(true)] protected bool OtherMethod(){ return true; } [ComVisible(true)] public int Property { get { return 0; } } // Other implementation code goes here. }
When this code runs, it will expose one or more methods to the client application through COM.
Which member or members will be exposed? (Choose all that apply) Method
The class included the following code segment: [Com Visible(false)] public class Class { public Class() { // Implementation code goes here. } [ComVisible(true)] public int Method(string param) { return 0; } [ComVisible(true)] protected bool OtherMethod(){ return true; } [ComVisible(true)] public int Property { get { return 0; } } // Other implementation code goes here. }
When this code runs, it will expose one or more methods to the client application through COM.
Which member or members will be exposed? (Choose all that apply) Property
You want to minimize any possible disruption to the COM interface as a result of code changes.
Which code segment should you use? [Guid(“9ED54F84-A89D-4fcd-A854-44251E925F09â€)] public interface IClassToExpose { public int Calc(); } [ClassInterface[ClassInterfaceType.None)] public int Calc() { // Implementation code goes here. } }
You want to minimize any possible disruption to the COM interface as a result of code changes.
Which code segment should you use? [ClassInterface(ClassInterfaceType.AutoDispatch)] public class ClassToExpose { public int Calc() { // Implementation code goes here. } }
public class Tester { public static void Main(string[] Args) { AdminService service = new AdminService(); // Code to exercise the service object. } }
You write a configuration file for Tester.exe. The configuration file is named Tester.exe.config and includes the following code segment: <configuration> <system.runtime.remoting> <application> <client> <wellknown url=â€http://LocalHost/AdminService/AS.rem†type=â€AdminService, AdminServiceâ€/> </client> </application> </system.runtime.remoting> </configuration>
You run Tester.exe. The application immediately throws a System.NullReferenceException. The exception includes the following message: “Object reference not set to an instance of an object.â€
You need to resolve this exception.
What should you do? To the application element of the Tester.exe.config file, add the following code segment: <channels> <channel ref=â€httpâ€> <clientProviders> <formatter ref=â€binaryâ€/> </clientProviders> </channel> </channels>
public class Tester { public static void Main(string[] Args) { AdminService service = new AdminService(); // Code to exercise the service object. } }
You write a configuration file for Tester.exe. The configuration file is named Tester.exe.config and includes the following code segment: <configuration> <system.runtime.remoting> <application> <client> <wellknown url=â€http://LocalHost/AdminService/AS.rem†type=â€AdminService, AdminServiceâ€/> </client> </application> </system.runtime.remoting> </configuration>
You run Tester.exe. The application immediately throws a System.NullReferenceException. The exception includes the following message: “Object reference not set to an instance of an object.â€
You need to resolve this exception.
What should you do? At the beginning of the Main method in Tester.exe, add the following line of code: RemotingConfiguration.Configure(“Tester.exe.configâ€);
You want client applications to connect to Patientinfo over a secure communication channel. You want to accomplish this task by writing the minimum amount of code.
What should you do? Install Patientinfo in an Internet Information Services (IIS) virtual directory. Configure Patientinfo to use an HttpChannel and a SoapFormatter. Configure IIS to use SSL.
The Time class is hosted in an Internet Information Services (IIS) virtual directory named UtilsSvr. The Time class is configured to be a server-activated object and uses a URI named Time.rem.
You use a client application named client.exe to test the Time object. client.exe creates instances of the Time object by using the following method signature:
public Time CreateInstance() { RemotingConfiguration.Configure(“client.exe.configâ€); return new Time(); }
You want client.exe to create instances of the Time class on a compute named Hosting.
What should you do? Create a client.exe.config file that includes the following code segment: <configuration> <system.runtime.remoting> <application> <client> <wellKnown type=â€Utils.Time, client†url=â€http://Hosting/UtilsSvr/Time.remâ€/> </client> </application> </system.runtime.remoting> </configuration>
The Time class is hosted in an Internet Information Services (IIS) virtual directory named UtilsSvr. The Time class is configured to be a server-activated object and uses a URI named Time.rem.
You use a client application named client.exe to test the Time object. client.exe creates instances of the Time object by using the following method signature:
public Time CreateInstance() { RemotingConfiguration.Configure(“client.exe.configâ€); return new Time(); }
You want client.exe to create instances of the Time class on a compute named Hosting.
What should you do? Create a client.exe.config file that includes the following code segment: <configuration> <system.runtime.remoting> <application> <client url=â€http://Hosting/UtilsSvr/Time.remâ€> <activated type=â€Utils.Time, clientâ€/> <client> </application> </system.runtime.remoting> </configuration>
What should you do? Use the Component Services tool to add the FultonBankTellers group to the existing Tellers role.
What should you do? To the Item assembly, add the following attribute: [assembly: ApplicationQueuing(Enables=true, QueueListenerEnabled=true)]
[Guid(“0B6ABB29-43D6-40a6-B5F2-83A457D062ACâ€)] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IOrderInit { // IOrderInit methods go here. } public class OrderProcessor: ServicedComponent, IOrderInit { // OrderProcessor methods go here. }
You discover that every time you rebuild OrderProcessor, existing unmanaged client code fails. The HRESULT for the exception is 0x80040154. The exception includes the following message: “Class not registeredâ€. You need to resolve this problem.
What should you do? Add a Guid attribute to the OrderProcessor class.
[Guid(“0B6ABB29-43D6-40a6-B5F2-83A457D062ACâ€)] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IOrderInit { // IOrderInit methods go here. } public class OrderProcessor: ServicedComponent, IOrderInit { // OrderProcessor methods go here. }
You discover that every time you rebuild OrderProcessor, existing unmanaged client code fails. The HRESULT for the exception is 0x80040154. The exception includes the following message: “Class not registeredâ€. You need to resolve this problem.
What should you do? To the OrderProcessor class, add the following attribute: [ClassInterface(ClassInterfaceType.AutoDual)]
You write a console application named Coverage.exe to test each method in Scheduler.
You want Coverage.exe to test Scheduler for multiple cultures to verify its globalization support.
What should you do? Set the current thread’s CurrentCulture property to each culture locale before calling the Scheduler methods.
You discover that there are logic problems in the Create New Session method. You want to debug any calls to this method.
What should you do? Attach the debugger to a Dllhost.exe process. Set a breakpoint on the CreateNewSession method.
You want to secure StockQuote so that it can only be accessed by users in the Customers and Managers roles.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two) To the StockQuote class, add the following attribute: [ComponentAccessControl]
You want to secure StockQuote so that it can only be accessed by users in the Customers and Managers roles.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two) To the StockQuote class, ad the following attributes: [SecurityRole(“Customersâ€, false)] [SecurityRole(“Managersâ€, false)]
You are preparing to hand off Tracker to and administrator for deployment to production computers. You want all the COM+ configuration information for Tracker to be installed on the production computers.
What should you do? Use the Component Services tool to export Tracker to an .msi file. Provide to the administrator the .msi file with instructions to run the installer.
What should you do? Configure App to be a library application.
You create the following method in Service: private void ProcessOrders(object source, ElapsedEventArgs eventArgs) { // Logic to process Orders table goes here. }
You need to add additional code to Service to invoke the ProcessOrders method.
What should you do? To the OnStart method, add the following code segment: Timer Timer = new Timer(); Timer.Elapsed += new ElapsedEventHandler(ProcessOrders); Timer.Interval = 30000; Timer.Enabled = true;
You create the following method in Service: private void ProcessOrders(object source, ElapsedEventArgs eventArgs) { // Logic to process Orders table goes here. }
You need to add additional code to Service to invoke the ProcessOrders method.
What should you do? To the OnStart method, add the following code segment: Timer Timer = new Timer(); Timer.Elapsed += new ElapsedEventHandler(ProcessOrders); Timer.Interval 30000; Timer.AutoReset = true;
What should you do? Start the Windows service. Then attach a debugger to the process.
You need to ensure that role-based security is enforced in the assembly. You want to accomplish this goal by adding an attribute to the project source code.
Which attribute should you use? [assembly: ApplicationAccessControl(AccessChecksLevel = AccessChecksLevelOption.ApplicationComponent)]
[WebMethod(TransactionOption.RequiresNew)] public DataSet PlaceOrder(DataSet orderData) { Server1.BrakesService brakes = new Server1.BrakesService(); Server2.PartsService parts = new Server2.PartsService(); // Call OrderBrakes to order only brakes. brakes.OrderBrakes(orderData.Tables[“Brakesâ€]); // Call OrderParts to order all other auto parts. parts.OrderParts(orderData.Tables[“Partsâ€]); }
BrakesService and PartsService are XML services. The TransactionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required. You develop a Windows Forms application named PartOrderApp that consumes AutoPartsService. You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.
What is the most likely result? OrderParts stops processing the order, and all orders are cancelled.
[WebMethod(TransactionOption.RequiresNew)] public DataSet PlaceOrder(DataSet orderData) { Server1.BrakesService brakes = new Server1.BrakesService(); Server2.PartsService parts = new Server2.PartsService(); // Call OrderBrakes to order only brakes. brakes.OrderBrakes(orderData.Tables[“Brakesâ€]); // Call OrderParts to order all other auto parts. parts.OrderParts(orderData.Tables[“Partsâ€]); }
BrakesService and PartsService are XML services. The TransactionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required. You develop a Windows Forms application named PartOrderApp that consumes AutoPartsService. You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.
What is the most likely result? OrderParts continues processing the order, and all orders are placed.
[WebMethod(TransactionOption.RequiresNew)] public DataSet PlaceOrder(DataSet orderData) { Server1.BrakesService brakes = new Server1.BrakesService(); Server2.PartsService parts = new Server2.PartsService(); // Call OrderBrakes to order only brakes. brakes.OrderBrakes(orderData.Tables[“Brakesâ€]); // Call OrderParts to order all other auto parts. parts.OrderParts(orderData.Tables[“Partsâ€]); }
BrakesService and PartsService are XML services. The TransactionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required. You develop a Windows Forms application named PartOrderApp that consumes AutoPartsService. You run PartOrderApp and place and order for three sets of brakes and four wheels. While PlaceOrder is placing the order for the wheels, you close PartOrderApp.
What is the most likely result? OrderParts stops processing the order, the brakes are ordered, but the wheels are not ordered.
You deploy Fulton1. You discover that some client applications are rejecting your XML formatting because the XML is inconsistent with the expected standard. You want to debug this problem by tracing the XML responses.
What should you do? In the Web.config file, enable tracing by setting the enabled attribute of the trace element to “trueâ€.
You deploy Fulton1. You discover that some client applications are rejecting your XML formatting because the XML is inconsistent with the expected standard. You want to debug this problem by tracing the XML responses.
What should you do? Create a SOAP extension to log the SoapMessageStage.AfterSerialize output to a log file.
You find that Service1 does not display assertion failure messages. Instead, Fulton1 returns an HTTP 500 error message when an assertion fails. You want to view the assertion failure messages.
What should you do? Modify the compilation element of the Web.config file by setting the debug attribute to “trueâ€.
You find that Service1 does not display assertion failure messages. Instead, Fulton1 returns an HTTP 500 error message when an assertion fails. You want to view the assertion failure messages.
What should you do? In the constructor for Fulton1, add an EventLogTraceListener object to the Listeners property of the Debug class.
If a customer ID is not passed as part of a SOAP header, you want the service to refuse the request. You want these service refusal messages to be logged to an event log named LatLongLog. You anticipate that there will be a lot of these log entries over time. A string object named refusalMessage contains the message to log.
Which code segment should you use? if (!EventLog.SourceExists(“LatLongSourceâ€)) { EventLog.CreateEventSource(“LatLongSourceâ€, “LatLongLogâ€); } EventLog.WriteEntry(“LatLongSourceâ€, refusalMessage, EventLogEntryType.Error);
You create an ASP.NET application named PhoneBook that contains a Web reference to PhoneNumberService. You need to wrap any calls made to PhoneNumberService in a try/catch block to catch any PhoneNumberException that may be thrown.
Which two code segments are possible ways to achieve this goal (Each correct answer presents a complete solution.)? (Choose two) try { // Code to call PhoneNumberService method goes here. } catch (SoapException ex) { // Handle the exception. }
You create an ASP.NET application named PhoneBook that contains a Web reference to PhoneNumberService. You need to wrap any calls made to PhoneNumberService in a try/catch block to catch any PhoneNumberException that may be thrown.
Which two code segments are possible ways to achieve this goal (Each correct answer presents a complete solution.)? (Choose two) try { // Code to call PhoneNumberService method goes here. } Real-Certify.com The Only Way to get Certified Quickly. - 112 - catch (Exception ex) { // Handle the exception. }
During implementation, you use the Debug class to record debugging log messages, to verify values, and to report debugging failures. You want to deploy PostalCode to a production computer. You do not want any of the debugging code to execute on the production computer.
What should you do? Set the project’s active configuration to Release and rebuild the DLL.
During implementation, you use the Debug class to record debugging log messages, to verify values, and to report debugging failures. You want to deploy PostalCode to a production computer. You do not want any of the debugging code to execute on the production computer.
What should you do? Modify the compilation element of the Web.config file by setting the debug attribute to “falseâ€.
ReportService includes a method named SubmitSurveillance that calls a serviced component named ReportData. ReportData uses COM+ role-bases security to restrict component access to members of the COM+ Agents role. The COM+ Agents role is configured to include the FieldAgents group.
You call SubmitSurveillance. However, when the call to ReportData is attempted, an exception is thrown indicating that access is denied. You need to correct this problem.
What should you do? In the <system.web> section of the Web.config file, add the following line of code: <identity impersonate=â€trueâ€/>
Which URL should you use? http://Srv/AppPath/myService.asmx
You discover that when TimeService creates TimeServiceLog, it throws a System.Security.SecurityException. The exception includes the following message: “Requested registry access is not allowedâ€. You need to resolve this problem.
What should you do? Configure Inetinfo.exe to run as the local administrator user account.
You discover that when TimeService creates TimeServiceLog, it throws a System.Security.SecurityException. The exception includes the following message: “Requested registry access is not allowedâ€. You need to resolve this problem.
What should you do? Create an installer for TimeService, and create the new event log in the installer code.
You need to provide callers of this service with the URL they need to issue an HTTPGET against WeatherService.
Which URL should you use? http://Srv/AppPath/WeatherService.asmx/RetrieveWeather?cityname=somecity
A new customer subscribes to SilverService. You need to create a discovery document that enables this customer to use only SilverService.
Which discovery document should you create? <disco:discovery xmlns:disco=â€http://schemas.xmlsoap.org/disco/†xmlns:scl=http://schemas.xmlsoap.org/disco/scl/> <scl:contractRef ref=â€SilverService.asmx?wsdl†/> </disco:discovery>
The service does not support all international tax rates. You want to find out which unsupported tax rates are being requested by users. If a user requests a tax rate that is not supported, the service records the request by using a trace message. You then want to view the unsupported rates that have been requested.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two) Modify the trace element in the Web.config file of the service by setting the enabled attribute to “trueâ€.
The service does not support all international tax rates. You want to find out which unsupported tax rates are being requested by users. If a user requests a tax rate that is not supported, the service records the request by using a trace message. You then want to view the unsupported rates that have been requested.
Which two actions should you take (Each correct answer presents part of the solution.)? (Choose two) View the page at http://Production/WS/Trace.axd.
You want to deploy the service without having to manually configure any settings on the production computer.
Which deployment mechanism should you use? Web setup project
All 50 connections are now in use. However, a request for connection number 51 is received.
What is the most likely result? The request is queued until a connection becomes available or until the timeout limit is reached.
You move the service to a production computer. You must configure the production XML Web service to output only error messages to the log file.
What should you do? To the Web.config file, add the following code segment: <system.diagnostics> <switches> <add name=â€Switch†value=â€1†/> </switches> </system.diagnostics>
You move the service to a production computer. You must configure the production XML Web service to output only error messages to the log file.
What should you do? To the Web.config file, add the following code segment: <system.diagnostics> <switches> <add name=â€TraceSwitch†value=â€1†/> </switches> </system.diagnostics>
On the command line of A, you enter and run the following command: Installutil 1 2 3
During the installation process, 3 throws an installation error. The installation process completes.
How many of the three services are now installed on A? None
Both components use pricing data. OrderPipeline reads the pricing data for placing user orders. OrderAdmin modifies the pricing data.
You want to ensure that OrderPipeline accesses the pricing data as quickly as possible, while still being able to immediately retrieve any pricing changes made by OrderAdmin.
What should you do? Store the pricing data in a Hashtable object within OrderAdmin. Expose the Hashtable object through a property on OrderAdmin.
<system.runtime.remoting> <application> <service> <activated type=â€Assembly.RemoteObject1, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj†/> <wellKnown mode=â€SingleCall†objectUri=â€RemoteObject2.rem†type=â€Assembly.RemoteObject2, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj†/> <channels> <channel ref=â€http†/> </channels> </service> </application> </system.runtime.remoting>
You create an application named App that resides on a different computer than Assembly. App references version 1.0.0.0 of Assembly. App contains code that activates instances of RemoteObject1 and RemoteObject2 to use their services.
Due to changes in business needs, you must update Assembly. You create version 2.0.0.0 of Assembly, which is backward compatible, but you do not update any information in the App.config file of Assembly. You register version 2.0.0.0 of Assembly in the global assembly cache. You then rebuild App.
Which version of the remote object will MyApp activate? Version 1.0.0.0 of RemoteObject1; version 1.0.0.0 of RemoteObject2.
<system.runtime.remoting> <application> <service> <activated type=â€Assembly.RemoteObject1, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj†/> <wellKnown mode=â€SingleCall†objectUri=â€RemoteObject2.rem†type=â€Assembly.RemoteObject2, Assembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=28dckd83491duj†/> <channels> <channel ref=â€http†/> </channels> </service> </application> </system.runtime.remoting>
You create an application named App that resides on a different computer than Assembly. App references version 1.0.0.0 of Assembly. App contains code that activates instances of RemoteObject1 and RemoteObject2 to use their services.
Due to changes in business needs, you must update Assembly. You create version 2.0.0.0 of Assembly, which is backward compatible, but you do not update any information in the App.config file of Assembly. You register version 2.0.0.0 of Assembly in the global assembly cache. You then rebuild App.
Which version of the remote object will MyApp activate? Version 1.0.0.0 of RemoteObject1; version 2.0.0.0 of RemoteObject2.
Service1 exposes two Web methods named Authenticate and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate generates q unique key, stores that key by using the Session object, and returns that key.
RetrieveData expects a valid key that has been generated by Authenticate as inout before it will return data. If the key matches the key in the current session, RetrieveData will return data to the customer.
You write the following code segment in the Load event handler of Form1. (Line numbers are included for reference only) 01 localhost.Service1 service1 = new localhost.Service1(); 02 string key = “â€; 03 DataSet userData; 04 // Insert new code. 05 key = service1.Authenticate(myUser, myPassword); 06 userData = service1.RetrieveData(key); 07 dataGrid1.DataSource = userData;
You run the application. When line 06 executes the Web service throws an exception, which indicates that the key is invalid. To ensure that the application runs without exceptions, you must insert additional code on line 04.
Which code segment should you use? service1.PreAuthenticate = true;
Service1 exposes two Web methods named Authenticate and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate generates q unique key, stores that key by using the Session object, and returns that key.
RetrieveData expects a valid key that has been generated by Authenticate as inout before it will return data. If the key matches the key in the current session, RetrieveData will return data to the customer.
You write the following code segment in the Load event handler of Form1. (Line numbers are included for reference only) 01 localhost.Service1 service1 = new localhost.Service1(); 02 string key = “â€; 03 DataSet userData; 04 // Insert new code. 05 key = service1.Authenticate(myUser, myPassword); 06 userData = service1.RetrieveData(key); 07 dataGrid1.DataSource = userData;
You run the application. When line 06 executes the Web service throws an exception, which indicates that the key is invalid. To ensure that the application runs without exceptions, you must insert additional code on line 04.
Which code segment should you use? service1.InitializeLifetimeService();
Service1 exposes two Web methods named Authenticate and RetrieveData. Both methods have sessions enabled. Authenticate authenticates a caller. If the caller is authenticated, Authenticate generates q unique key, stores that key by using the Session object, and returns that key.
RetrieveData expects a valid key that has been generated by Authenticate as inout before it will return data. If the key matches the key in the current session, RetrieveData will return data to the customer.
You write the following code segment in the Load event handler of Form1. (Line numbers are included for reference only) 01 localhost.Service1 service1 = new localhost.Service1(); 02 string key = “â€; 03 DataSet userData; 04 // Insert new code. 05 key = service1.Authenticate(myUser, myPassword); 06 userData = service1.RetrieveData(key); 07 dataGrid1.DataSource = userData;
You run the application. When line 06 executes the Web service throws an exception, which indicates that the key is invalid. To ensure that the application runs without exceptions, you must insert additional code on line 04.
Which code segment should you use? service1.CookieContainer = new System.Net.CookieContainer();
You verify that your application is the only application that is using SQL Server. Your application runs all code segments by using the same identity. You run the application. Connection pooling is enabled, and the entire application runs within the connection timeout parameter.
How many connection pools are created? Three
You need to configure your database component assemblies to accomplish this goal.
What should you do? Apply the StrongNameIdentityPermission attribute, and specify SecurityAction.RequestMinimum. Set the PublicKey property to the public key of the key file you use to sign your application’s assemblies.
You want to ensure that Service starts from App if Service is not already running.
Which code segment should you use? ServiceController ServiceController = new ServiceController(“Serviceâ€); if (ServiceController.Status == ServiceControllerStatus.Stopped) { ServiceController.Start(); }
Calls to ChargeCard take one minute to complete. You do not want users to have to wait while ChargeCard executes. You want users to be taken automatically to the next Web page of the application.
Which code segment should you use to call CreditService? CreditService.BeginChargeCard(ccNumb, billAddress, amount, new AsyncCallback(CCResponse), null); Server.Transfer(“process.aspxâ€); private void CCResponse(IAsyncResult aRes) { CreditService.EndChargeCard(aRes); }
You want to develop a server application to host BatchOrder objects.
What should you do? Create a Windows service, and register BatchOrder as a client-activated object.
What should you do? Use an AsyncDelegate instance to call the Load method.
You have an Internet Information Services (IIS) virtual directory named PromotionsObject. The fullrun.dll file is in the PromotionsObject\bin directory. You want to host the Promotions class in IIS.
What should you do? Create a Web.config file that includes the following code segment: <configuration> <system.runtime.remoting> <application> <service> <wellknown> mode=â€SingleCall†objectUri=â€Promotions.rem†type=â€Promotions,â€/> </service> <channels> <channel ref=â€httpâ€/> </channels> </application> </system.runtime.remoting> </configuration>
You want to deploy the Scheduler object to a computer named Fulton1 so that client applications can begin to use it.
You copy TaskScheduler.dll, SchedulerServer.exe, and SchedulerServer.exe.config to a directory on Fulton1.
What should you do next? Configure Fulton1 to execute SchedulerServer.exe each time Fulton1 is restarted. Then manually execute SchedulerServer.exe on Fulton1.
You want to write a client application that creates and uses a Utils object. You want the client application to hold onto a reference to a Utils object for the duration of its execution.
What should you do? In the client application, create an Implementation of the ISponsor interface. Implement the Renewal method to extend the lease.
You want to create a DataView object named customersDataView that contains only customers in which the value in the Region column is France.
Which code segment should you use? DataView customersDataView = new DataView(customersDataSet.Tables[“Customersâ€]); customersDataView.RowFilter= (“Region = ‘France’â€);
You want to apply the data changes in DataSet to the database. You decide to use the SqlClient data provider.
You need to create a data object that you will use to update the database.
Which code segment should you use? SqlDataAdapter mySqlDataAdapter = new sqlDataAdapter();
What should you do? Add a data relation to DataSet on OrderID between Customers and Orders.
You want to merge assetCustomersDataSet into loanCustomersDataSet and preserve the original values in loanCustomersDataSet.
Which code segment should you use? loanCustomersDataSet.Merge(assetCustomersDataSet, true);
You create a DataRelation object named orderRelation between Orders and OrderDetails on OrderID. Order is the parent table. OrderDetails is the child table.
You add orderRelation to the ordersDataSet relation collection by using the following line of code:
ordersDataSet.Relations.Add(orderRelation;
You verify that prior to adding orderRelation, there were no constraints on either table.
You then run the line of code.
How many constraints does each table have now? None on Orders; none on OrderDetails.
You create a DataRelation object named orderRelation between Orders and OrderDetails on OrderID. Order is the parent table. OrderDetails is the child table.
You add orderRelation to the ordersDataSet relation collection by using the following line of code:
ordersDataSet.Relations.Add(orderRelation;
You verify that prior to adding orderRelation, there were no constraints on either table.
You then run the line of code.
How many constraints does each table have now? One on Orders; one on OrderDetails.
You are creating a function that accepts a parameter of EmployeeID and searches Employees to return the DataRow object for the specified EmployeeID.
You want to use the Find method of the rows collection in Employees to return the requested DataRow object from the function. You need to ensure that you can use the Find method to accomplish this goal.
What should you do? Ensure that Employees has a primary key on EmployeeID.
Which code segment should you use? long weeklyOrderQuantity = 0; while (ordersDataReader.Read()) { myFunction((int)ordersDataReader[“OrderQuantityâ€]); }
• ProductID as Integer • ProductName as nvarchar(40) • UnitsInStock as Integer
You want to use productsDataReader to create an inventory management report.
You define the following three variables: • int myProductID; • string myProductName; • int myUnits;
You need to ensure that the report runs as quickly as possible.
Which code segment should you use? myProductID = (int) productsDataReader[0]; myProductName = (string) productsDataReader[1]; myUnits = (int) productsDataReader[2];
Customers and Orders have a data column named CustomerID. Orders and OrderDetails have a data column named OrderID. Orders have a foreign key constraint between Customers and Orders on CustomerID.
OrderDetails has a foreign key constraint between Orders and OrderDetails on OrderID.
You want to populate Customers, Orders and OrderDetails with data from Microsoft SQL Server database.
In which order should you fill the Data table objects? Customers Orders OrderDetails
You receive version 2.0.0.0 of Component, which you install in the global assembly cache. You reconfigure the application configuration file to redirect calls to version 2.0.0.0.
You now receive version 3.0.0.0 of Component, which you install in the global assembly cache. You do not reconfigure the application configuration file. You then run MyApp.
Which version of Component is loaded and from which location is it loaded? Version 2.0.0.0 from the global assembly cache.
You develop a new ASP.NET application named WebApp2 that also needs to use Employee. You assign Employee a strong name, set its version to 1.0.0.0, and install it in the global assembly cache. You then create a publisher policy assembly for version 1.0.0.0 and install it in the global assembly cache.
You compile WebApp2 against version 1.0.0.0. You do not recompile MyWebApp. You then run WebApp.
What is the most likely result? Employee is loaded from the bin directory.
You develop a new ASP.NET application named WebApp2 that also needs to use Employee. You assign Employee a strong name, set its version to 1.0.0.0, and install it in the global assembly cache. You then create a publisher policy assembly for version 1.0.0.0 and install it in the global assembly cache.
You compile WebApp2 against version 1.0.0.0. You do not recompile MyWebApp. You then run WebApp.
What is the most likely result? Version 1.0.0.0 of Employee is loaded by the publisher policy assembly.
Both objects have the same structure. You want to merge assetCustomersDataSet into loanCustomersDataSet and preserve the original values in loanCustomerDataSet.
Which code segment should you use? loanCustomersDataSet.Merge (assetCustomersDataSet, True);
You need to write code that will create a typed DataSet object on the basis of product information. Your code will be used in several Visual studio .NET applications to speed up data processing.
You need to create this code as quickly as possible.
What should you do? Use the Xml Schema Definition tool (Xsd.exe) to generate the code.
You create a SQL SELECT statement in a local variable named SQLSelect. You need to instantiate a SqlConnection object and a SqlCommand object that you will use to populate the DataReader object.
Which code segment should you use? OleDbConnection Connection = new OleDbConnection (OleDbConnectionString); OleDbCommand Command = new OleDbCommand (SQLSelect, Connection);
Which class should you use to retrieve the data? DataReader
You instantiate a SqlCommand object named Command that you will use to populate a DataReader object named customersDataReader. You need to initialize Command to load customersDataReader to include FamilyName and PersonalName for all rows in Customers.
Which code segment should you use? Command.CommandText = “SELECT FamilyName,“ + “PersonalName FROM Customersâ€;
You need to ensure that the application processes the data as quickly as possible.
Which code segment should you use? SqlConnection myConnection = new SqlConnection (“Data Source=(local);Initial Catalog=;†+ “Integrated Security=trueâ€); SqlCommand myCommand = new SqlCommand (“SELECT * FROM Ordersâ€; myConnection); SqlDataReader ordersDataReader; myConnection.Open(); ordersDataReader = myCommand.ExecuteReader();
You need to develop an application that reads Orders every 15 minutes and sends all new orders to the order fulfillment department. The application will run on computer that is used by several users who continuously log on and log off from the network to perform miscellaneous tasks.
Which type of .NET application should you use? Windows service
You instantiate a SqlCommand object named Command. You need to initialize Command to return the company name for @CustomerID with a value of “ALFKIâ€.
Which code segment should you use? Command.CommandText = “GetCompanyNameâ€; Command.Parameters.Add(“@CustomerIDâ€, “ALFKIâ€);
You need to write code that will execute the stored procedure and return the result as an integer value.
You instantiate a SqlCommand object named myCommand and initialize all appropriate parameters.
Which myCommand method should you use? ExecuteScalar