Just a couple of problems I'm working on-- can anyone help. Thanks.
1. You are making changes to an existing ASP.NET application. The application contains a DataSet object, dsProspect. The page you are changing displays prospect data from the dsProspect DataSet and includes an Update button. You define a new DataSet named dsStudent, and add this line of code to the Click event handler of the Update button:
dsStudent = dsProspect.GetChanges();
Which statement represents the result of executing this line of code?
A. The dsProspect DataSet will contain only modified rows
B. The dsStudent DataSet will contain all rows from the dsProspect DataSet.
C. The dsStudent DataSet will contain all modified rows from the dsProspect DataSet
D. An error will occur because the statement is not syntactically correct
2. Your ASP.NET application tracks donations for a non-profit agency. The application contains a Web Form, which displays all donations in a DataGrid control, DonorGrid. The data grid contains seven columns: lname, fname, donationdate, donationdesc, dtype, dsubtype, and damount.
Your data resides in a SQL Server 2000 database and is available through a DataSet, named dsDonor.
You want to allow users to sort the data in the grid. When a user clicks a button, you want the data in the grid to be sorted descending by damount, and then sorted alphabetically by lname and fname. You decide to use a DataView object to accomplish this.
Which code fragment should you use?
DataView dv = new DataView();
dv.Table = dsDonor.Tables[0];
dv.ApplyDefaultSort = true;
DonorGrid.DataSource = dv;
DonorGrid.DataBind();
OR
DataView dv = new DataView();
dv.Table = dsDonor.Tables[0];
dv.Sort = "damount DESC, lname, fname";
DonorGrid.DataSource = dv;
DonorGrid.DataBind();
OR
DataView dv = new DataView();
dv.Table = dsDonor.Tables[0];
dv.Sort = "lname, fname, damount DESC";
DonorGrid.DataSource = dv;
DonorGrid.DataBind();
OR
DataView dv = new DataView();
dv.Table = dsDonor.Tables[0];
dv.Sort[1] = "damount DESC";
dv.Sort[2] = "lname ASC, fname ASC";
DonorGrid.DataSource = dv;
DonorGrid.DataBind();