Web design templates - CHAPTER 8 WRITING TO THE DATABASE 1.

CHAPTER 8 WRITING TO THE DATABASE 1. Open Players_Insert.aspx and switch to the Design view. 2. Add a new CheckBoxList before the Insert Player button. Rename it FormatList, set its RepeatColumns property to 4 and its RepeatDirection to Horizontal. The layout should now be as shown in Figure 8-6. Figure 8-6. The new layout showing the Supported Formats CheckBoxList 3. Switch to the Source view and modify the Page_Load event as follows: protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { // populate the list of manufacturers PopulateManufacturers(); // populate the list of formats PopulateFormats(); } } 4. Add the new PopulateFormats() method: private void PopulateFormats() { // create the connection string strConnectionString = ConfigurationManager. ConnectionStrings[”SqlConnectionString”].ConnectionString; SqlConnection myConnection = new SqlConnection(strConnectionString);
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply