Ice01Data Exploration 2

Note:  Please keep the programs that you create today, in case you have a question about your grades for the ICEs at the end of the quarter. When you're working with a partner, each person should save his-or-her own copy.

 Objectives  Resources
  • Gain confidence debugging ASP.NET pages
  • Familiarize yourself with the ASP.NET SDK Documentation (Microsoft)
  • Explore using data sources and data controls in web pages

ICE ICE 05 INSTRUCTIONS

SETUP EXERCISE ENVIRONMENT

  1. Look at the Instructions from the previous ICE (ICE 04) to setup the exercise environment

ICE ICE 05 Part 1: Working with the DataSet, DataTable, and DataRow object to Modify Data

  1. Create a new datacontrol page by copying and pasting from datacontrol2.aspx
  2. Add a button object to the page, double click it from the design view to access its event handler
  3. Review the ASP.NET Documentation on adding a new row to a dataset.
  4. In additional, look through Working with Datasets in Visual Studios, especially the part called Datasets and XML to better understand how DataSets work.
  5. Use the DataSet object "soup" to create a new DataRow for the DataTable that holds the xml data.

    HINT: you must first get the DataTable object  from soup and then create a DataRow object based on the DataTable
  6. Modify the new DataRow to represent your favorite artists name, nationality, movement and birthdate (hardcode these at first)
  7. Add the new DataRow to the DataTable in the DataSet
  8. Rebind the GridView, to refresh its display on the webpage

ICE ICE 05 Part 2: Allow for User Input and Write to the XML File

  1. Add TextBox form elements to gather user data that you use to update the artist.xml file.
  2. Write the DataSet back out to the artist.xml file using the DataSource object. You will need to provide a file path in addition to the file name:

    string FilePame = Server.MapPath("~/App_Data/artists.xml")    

HINT: you may want to look at the following MrBool article: Adding and Removing Records from DataSet/XML and Populate Grid using ASP.NET and C#

When you get done with the above exercises, show your Instructor.