Ok .............. so this SHOULD be simple. I have a table with only 2 fields. One is an ID field with an integer datatype. The other is a GlobalArea field with a nvarchar datatype. I want the dropdownlist to be populated with the GlobalArea field from the table but I also need to be able to retain the ID value and pass that along to fill the results to my datadrid.
The code I have to fill the datalist:
Dim o_Department As New ztblDepartment()
Dim dsDepartment As New DataSet()
dsDepartment = o_Department.GetAll
Dim dvDepartment As New DataView(dsDepartment.Tables(0), "", "DepartmentsID", DataViewRowState.CurrentRows)
For Each r In dsDepartment.Tables(0).Rows
ddlDepartment.Items.Add(r.Item(1))
Next
ddlDepartment.DataSource = dvDepartment
ddlDepartment.DataTextField = "GlobalArea"
ddlDepartment.DataValueField = "DepartmentsID"
Table example:
ID GlobalArea
1 Accounting
2 Customer Service
I want the ID values to be put into a integer variable and passed to the selectedindexchanged event. How do I do this???
Please help if you can.
Corinne
The code I have to fill the datalist:
Dim o_Department As New ztblDepartment()
Dim dsDepartment As New DataSet()
dsDepartment = o_Department.GetAll
Dim dvDepartment As New DataView(dsDepartment.Tables(0), "", "DepartmentsID", DataViewRowState.CurrentRows)
For Each r In dsDepartment.Tables(0).Rows
ddlDepartment.Items.Add(r.Item(1))
Next
ddlDepartment.DataSource = dvDepartment
ddlDepartment.DataTextField = "GlobalArea"
ddlDepartment.DataValueField = "DepartmentsID"
Table example:
ID GlobalArea
1 Accounting
2 Customer Service
I want the ID values to be put into a integer variable and passed to the selectedindexchanged event. How do I do this???
Please help if you can.
Corinne