Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DropDownList initialization question
Message
 
To
04/05/2004 15:43:49
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00900902
Message ID:
00900927
Views:
26
John,
Maybe I did this wrong. I got an error...
here's what I did
        '--------------------------
        ' Create the SelectCommand...for Contacts.Company
        '--------------------------
        oledbCMD = New OleDbCommand("SELECT DISTINCT Company " & _
                                            "FROM Contacts " & _
                                            "ORDER BY Company", _
                                    oledbConn)
        '
        oledbDA.SelectCommand = oledbCMD
        oledbDA.Fill(oledbDS, "CompanyLookup")
        '
        cboCompanyLookup.DataSource = oledbDS.Tables("CompanyLookup")
        '
        cboCompanyLookup.DataTextField = "Company"
        cboCompanyLookup.DataValueField = "Company"
        cboCompanyLookup.EnableViewState = True
        cboCompanyLookup.DataBind()
        cboCompanyLookup.SelectedValue = -1
        '--------------------------
---------------
>set this.cboName.selectedvalue = -1
>
>>I want to have a blank as the first entry in my DropDownList.
>>When I populate the list from a table, how can I arrange for the first entry to be blank, if every row of my table has the field populated?
>>
>>TIA,
>>Rick
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform