Simply, I hope... As described in title... A Clear VB.Net example would be greatly appreciated.
The dropdown list is provided from code below.
How do I pass this value to Query another table using SelectedItem, to provide data to to the ReportViewer - I tried researching how to, but cant figure this one outPLEASE HELP!
Populate Dropdown List:
Public Sub LoadProdCategory()
Dim objConnPDC As SqlConnection
Dim mySettingsPDC As New NameValueCollection
mySettingsPDC = AppSettings
Dim strConnPDC As String
strConnPDC = mySettingsPDC("DIS_PHLINVENTORYConnectionString")
objConnPDC = New SqlConnection(strConnPDC)
objConnPDC.Open()
Dim strPDC As String
strPDC = "SELECT CategoryID, CategoryCode, CategoryDecode " & _
"FROM ICDbS_ddl_Category " & _
"Order by CategoryDecode ASC"
Dim ObjCmdPDC As New SqlCommand(strPDC, objConnPDC)
Dim ObjDRPDC As SqlDataReader
ObjDRPDC = ObjCmdPDC.ExecuteReader()
DropDownList1.DataTextField = "CategoryDeCode"
DropDownList1.DataValueField = "CategoryCode"
'Item_ProdCategory.SelectedValue = ("3")
DropDownList1.DataSource = ObjDRPDC
DropDownList1.DataBind()
DropDownList1.Items.Insert(0, "")
objConnPDC.Close()
End Sub