troubleshooting Question

Combobox to Textbox

Avatar of Larry Brister
Larry BristerFlag for United States of America asked on
ASP.NET
3 Comments2 Solutions437 ViewsLast Modified:
Good morning,
  I have a combobox on an ascx page that is populating fine from the ascx.vb page.

I need to populate a textbox on the same page with the selected value from the combobox.


the textbox name is CurrentPubDate .
the combobox name and code is below


Private Sub loadPubDate()
        Dim dbCon As New System.Data.SqlClient.SqlConnection
        Dim objCmd As New SqlClient.SqlCommand
        dbCon.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("strConPEP")
        dbCon.Open()
        Dim adapter As New SqlDataAdapter("SELECT CONVERT(VARCHAR(10), datSunday, 101) as datSunday FROM getSunday", dbCon)
        Dim dt As New DataTable()
        adapter.Fill(dt)
        dbCon.Close()
        listPubDate.DataTextField = "datSunday"
        listPubDate.DataValueField = "datSunday"
        listPubDate.DataSource = dt
        listPubDate.DataBind()
        listPubDate.Items.Insert(0, New RadComboBoxItem(""))

        Dim item As RadComboBoxItem

        For Each item In listPubDate.Items
            item.ToolTip = item.Text
        Next item
    End Sub

ASKER CERTIFIED SOLUTION
beauharder

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros