dropdownlist data

Jun 29 2006 1:10 PM
Hi, I want the user to select name from dropdownlist so I am displaying ename(varchar) field from database to a dropdownlist but i also have to pass ecode(varchar) corresponding to ename field to my stored procedure. I am writing the following code: ddl1.DataTextField = "ename" ddl1.DataValueField = "ecode" temp1 = ddlSch.DataTextField where temp1,temp2 are string variables When i debug the project, temp1 doesnot shows the selected name from the dropdownlist. Also, to keep track of the code value and pass variable temp2 to the stored procedure, i am writing the following code: Dim j As Integer For j = 0 To ddlSch.SelectedIndex temp2 = ddlSch.DataValueField Next j Its not doing anything. Anyone plz. help me out, will be highly thankful ! Thanks Monica

Answers (2)