Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting the selected data value from the drop down list
Message
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00714584
Message ID:
00714595
Views:
17
You can use the sender object. You need to cast it first to the DropDownList type so you can access it's PEMs. Here is the sample code:
CType(sender, DropDownList).SelectedItem.Value
>Cathi
>
>Thanks, I was thinking I was going to need to use the sender or e objects in the selected_IndexChanged. The value it returns in the integer value. How do I format my SQL text to address that, if I just hard code the value into the string it works, but trying to use the variable, I get no results.
>
>
>            Dim objSQLString As String
>            Dim cFilter As String
>            cFilter = lnSelectedFunctionType.ToString
>            objSQLString = "Select * from ProgramFunctions where FunctionTypeID = '" + cFilter + " '"
>            Dim objSQLCommand As New System.Data.SqlClient.SqlCommand(objSQLString, Me.SqlConnection1)
>            Dim objDataReader As SqlClient.SqlDataReader
>            Me.SqlConnection1.Open()
>
>            objDataReader = objSQLCommand.ExecuteReader()
>            Me.DataGrid1.DataSource = objDataReader
>            Me.DataGrid1.DataBind()
>            Me.SqlConnection1.Close()
>
>
>Thanks for your help
>Kirk
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform