Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2007, 07:20 AM
Registered User
 
Join Date: Mar 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to chandra_yvr
Default about dropdownlist selected change event

Hi,
In my webpage i have a dropdownlist.In this i obtain the items from datasource.say item1,item2....item5.
In the data base each item contains a checkbox with true/false and 2 textboxes namely id and description are stored in one table name "Test"

so in my current web page dropdownlist and 5 checkboxes and textboxes i have placed. whenever the user clicks item form dropdown list exaple item2 based on database "Test" values particular checkbox and textboxes are selected.I have tried this one but i am getting only First record in the "Test" table.How could record pointer moves based on selection of item in drop downlist.
I am showing my code.pls solve my problem
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
        cmd.CommandText = "select stage1checked,id1,des1,stage2checked,id2,des2,stag e3checked,id3,des3,stage4checked,id4,des4,stage5ch ecked,id5,des5 from stage"
        cmd.Connection = con
        con.Open()
        dr = cmd.ExecuteReader()
        If dr.Read Then
            CheckBox1.Checked = dr.Item(0)
            TextBox4.Text = dr.Item(1)
            TextBox11.Text = dr.Item(2)

            CheckBox2.Checked = dr.Item(3)
            TextBox5.Text = dr.Item(4)
            TextBox12.Text = dr.Item(5)

            CheckBox3.Checked = dr.Item(6)
            TextBox6.Text = dr.Item(7)
            TextBox13.Text = dr.Item(8)

            CheckBox4.Checked = dr.Item(9)
            TextBox7.Text = dr.Item(10)
            TextBox14.Text = dr.Item(11)

            CheckBox5.Checked = dr.Item(12)
            TextBox8.Text = dr.Item(13)
            TextBox15.Text = dr.Item(14)
        Else
            dr.Close()
            con.Close()

        End If

    End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDownList, DataSource and Selected Items kingroon ASP.NET 2.0 Basics 2 February 25th, 2008 10:41 AM
Dropdownlist index change event problem. thanigaimani83 ASP.NET 1.x and 2.0 Application Design 0 November 7th, 2007 06:40 AM
How to set selected item in Dropdownlist? MTLedari ASP.NET 2.0 Basics 4 December 27th, 2006 12:53 AM
DropDownList Selected Index = -1?? dorothee ASP.NET 1.0 and 1.1 Basics 4 June 11th, 2004 03:08 AM
selected value from dropdownlist control netwizard_01 ASP.NET 1.0 and 1.1 Basics 3 January 20th, 2004 09:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.