What should you do?
You create a Windows Forms application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5.
The application contains the following code segment.
public DataSet GetProductByID(string ProductID)
{
DataSet ds = new DataSet(“ProductList”);
string SqlSelectCommand = “Select * FROM PRODUCTS WHERE PRODUCTID=” + ProductID;
try
{
SqlDataAdapter da = new SqlDataAdapter();
SqlConnection cn = new SqlConnection(GetConnectionString());
SqlCommand cmd = new SqlCommand(SqlSelectCommand);
cmd.CommandType = CommandType.Text;
cn.Open();
da.Fill(ds);
cn.Close();
}
catch (Exception ex)
{
string msg = ex.Message.ToString();
//Perform Exception Handling Here
}
return ds;
}
You need to ensure that the code segment is as secure as possible.
What should you do?
Which two actions should you perform?
You are an enterprise application developer. You create a Web site that delivers multimedia content to subscribers. The Web site uses Message Transmission Optimization Mechanism (MTOM) to send and receive large files as attachments by using a Web service. You discover that you are unable to send and receive files that are greater than 10 MB in size. You need to ensure that the Web service can send or receive files of a large size with minimum overhead.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
What should you do?
You maintain a Windows Forms application and an ASP.NET application.
The Windows Forms application has the following features:
The application impersonates the logged-on user.
The data is stored in a Microsoft SQL Server 2008 database.
The application grants user access to data by calling the IPrincipal.IsInRole method on the basis of user
roles.
The ASP.NET application uses forms-based authentication to authenticate users.
You need to share the login and user role information between the Windows Forms application and the
ASP.NET application.
What should you do?
What should you do?
You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5.
The application stores human resources data in a Microsoft SQL Server 2008 database. A partial database schema is as shown in the exhibit.
(Click the Exhibit button.) Each time a row is added, modified, or deleted from the Employee table, a corresponding entry must be recorded
in the EmployeeChangeLog table. You need to implement the data change logging.
What should you do?
What should you do?
You are an enterprise application developer. You plan to create unit tests for an ASP.NET application. You need to ensure that all the resources that are obtained by the assembly during the unit tests are released.
What should you do?
What should you do?
You create a Windows application by using the .NET Framework 3.5.
You review the design for a Windows application that has the following features:
The data layer sends and receives data updates by using Microsoft Messaging Queue (MSMQ) 4.0.
Data is stored in a Microsoft SQL Server 2008 server database instance.
Data from a DataSet object is displayed in a DataGrid control.
The application is deployed to portable computers that can access the corporate network only when
plugged on to it. The data must be most securely stored when the computer is in offline mode.
You need to ensure that the portable computers can update data even when offline.
What should you do?
What should you do?
You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5.
You are designing the database schema of the application.
The database schema is as shown in the exhibit. (Click the Exhibit button.)
You need to ensure that the design meets the following requirements:
– The database contains no duplicate data.
– A category can contain zero or more products.
– Each product can be associated with zero or more categories.
What should you do?
What should you do?
You are an enterprise application developer. You are developing a component for a smart client application. The component will be accessed simultaneously by user interface threads and background threads. The threads must be able to access component properties and methods. The threads must not leave the component in an invalid state. You need to select an appropriate mechanism to ensure valid component state.
What should you do?
What should you do?
You maintain a Windows Forms application and an ASP.NET application.
The Windows Forms application has the following features:
The application impersonates the logged-on user.
The data is stored in a Microsoft SQL Server 2008 database.
The application grants user access to data by calling the IPrincipal.IsInRole method on the basis of user
roles.
The ASP.NET application uses forms-based authentication to authenticate users.
You need to share the login and user role information between the Windows Forms application and the
ASP.NET application.
What should you do?
What should you do?
You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5.
The application has a class that contains a method named NewEvent. The NewEvent method contains the following code segment.
using (SqlConnection cn = new SqlConnection(connString))
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = “prcEvent”;
cmd.Parameters.Add(“@Date”, SqlDbType.DateTime, 4);
cmd.Parameters.Add(“@Desc”, SqlDbType.VarChar, 8000);
cmd.Parameters.Add(“@Link”, SqlDbType.VarChar, 2048);
cmd.Parameters[“@Date”].Value = date;
cmd.Parameters[“@Desc”].Value = eventText;
cmd.Parameters[“@Link”].Value = eventLink;
cn.Open();
retcode = cmd.ExecuteNonQuery().ToString();
}
During the test process, a user executes the NewEvent method. The method fails and returns the following error message:
“A stored procedure named prcEvent requires a parameter named @Date.”
You need to resolve the error.
What should you do?