Hello,
I am doing one project in that i have drop down list and i retrieved data to that from database. Now i want insert one record to database but in my table Id is there now i want to insert the dropdown list index value to that id. here not the selected text from drop down list. the index value i have to save.
Here My tables
Columns (ID, RoomNo, Sharing) dropdown list have the Names. so now i don't want that name i want the index value of that selected dropdownlist.
pls can any one tell me how to do it.
Thanks

Munesh SharmaPosted Apr 3, 2014, 12:40 AM
""insert into table(ID,Name,Father) values( '"+this.dropdownlist1.selectedvalue+'",'"+textname.text+'", '"+this.textfather.text+"')
piyusha patravaliPosted Apr 3, 2014, 7:50 AM
I Just do dropdown1.SelectedIndex instead of dropdown1.text.
for example
cmd.Parameters.Add with value("@name", dropdown1.SelectedIndex);
vishnu vardhanPosted Apr 3, 2014, 7:05 AM
Hey i have one more problem, here i have 2 dropdown lists and one textbox my problem is first dropdown list has to fill with School Names and if i select any school Name the next dropdownlist has to fill with school room numbers (Selected SchoolName) and here in second dropdown list if select any room no then the text box has to fill with total no. of students.
here my Tables:
Schools(ID, SchoolName,S_Address)
Rooms (ID, Room_No, TotalNumberofStudents, School_ID)
here that school id is SchoolName Index Value based on that i want to do that. pls can u tell me how?
Thanks.