As a developer you are displaying product data from SQL Server. Product table has
Productid and ProductName. You write ADO.NET code that uses a SqlDataAdapter
object and a SqlCommand object to retrieve the product data from the database by calling
a stored procedure. You set the CommandType property of the SqlCommand object to
CommandType.StoredProcedure. You set the CommandText property of the object to procProductList. Your code successfully files a DataTable object with a list of products that is sorted by ProductID in descending order.
You want the data to be displayed in reverse alphabetic order by ProductName.
What should you do?

 Posted by Muhilan on 12/7/2009 | Category: ASP.NET Interview questions | Views: 13548
Select from following answers:
  1. Set the command text to "SELECT * FROM procProductList ORDER BY ProductName DESC;" then bind the DataGrid control to the DataTable object
  2. Create a new DataView object based on the DataTable object.
  3. Set the Sort Property of the DataView object to “ProductName DESC”.
  4. Bind the DataGrid control to the DataView object.
  5. All Above

Show Correct Answer

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response