读书人

众人能移万座山请高手来帮忙解题

发布时间: 2011-12-12 22:59:56 作者: rapoo

众人拾柴火焰高,请高手来帮忙解题
NO. 1 You are creating an ASP.NET page for TestKing. Employees at the company will use the page
to enter suggested names for new products. Each suggestion is saved in a Microsoft SQL
Server database. The table in the database for suggestion includes the following three columns.
Column name Content
EmployeeID identification number of employee making a suggestion
ProductID identification number for the product being named
Suggestion suggested name for product
To add a suggestion to the ASP.NET page, an employee logs on by entering the appropriate
EmployeeID and password. The employee then uses a drop-down list box to select a ProductID
and uses a grid to enter suggested names for that product. The employee can enter multiple
suggestions for a single products before submitting the page.
The database table has a unique index that includes the EmployeeID, ProductID, and
Suggestion columns. The unique index does not allow the same suggested name to be recorded
twice for the same product by the same employee.
You are using a SqlDataAdapter object to insert the suggestions into the database. If one of the
suggested names for a product is a duplicate, the database returns an error to your code. You
do not want such errors to interrupts processing. You want your code to continue inserting any
remaining suggestions entered by the employee. You also want to be able to access a list of any
suggested names that were skipped due to errors.
What should you do?
A: Create an event handler for the SqlDataAdapter object’s RowUpdated event.
In the event handler, if the SqlRowUpdatedEventArgs object’s Errors property returns a nonnull
value, then set the SqlDataAdapter object’s ContinueUpdateOnError property to true.
B: Create an event handler for the SqlDataAdapter object’s RowUpdated event.
In the event handler, if the SqlRowUpdatedEventArgs object’s UpdateStatus property has a
value of UpdateStatus.ErrorsOccured, then set the SqlDataAdapter object’s


ContinueUpdateOnErrorProperty to true.
C: Enclose your call to the SqlDataAdapter object’s Update method in a try/catch block.
In the Catch code, set the object’s ContinueUpdateOnError property to true.
D: Set the SqlDataAdapter object’s ContinueUpdateOnError property to true before calling the
object’s Update method.



[解决办法]

[解决办法]
汗,现在没时间看,回家好好研究;回答要中文英文?
[解决办法]

[解决办法]
公司是做物流的么。

读书人网 >asp.net

热点推荐