Binding Data to a Combo Box

Using ODP.Net,
Does anybody have sample code for binding a column in a table to a combo box in either a web form or in a window application in .NET 2003
Thanks,
Declan

There's nothing special about doing this with ODP.NET.
Any example of ADO.NET databinding should work with ODP.NET.
eg
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_RetreiveandProcessDatawithaSQLDataReader.asp
or
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=dotnet+databind+combobox
David

Similar Messages

  • A data-binding issue with a combo box.

    Hi,
    Iu2019m having a data-binding issue with a combo box.  The field it is bound to is an integer.  The valid values in the combo box are 1, 2, and 3.  If I add a record when it is set to 1 or 2, the value gets stored correctly.  If I add a record when it is set to 3, it is stored as 1.  However, I can bring up the record just added on the form, change it to 3, and click u201CUpdateu201D and it is saved correctly as 3.  If I change it so that the valid values are 4, 5, and 6, it saves a 1 regardless of what is selected in the combo box.  It looks like the combo box is correctly bound for updates but not for adds.  The table is a master type UDO.  Any ideas?  Iu2019m somewhat committed to the field being an integer.  I'm using 2007A PL47.
    Thanks,
    Mike
    Edited by: Mike Angelastro on Jul 1, 2009 2:43 PM

    I tried a few things on my own.  The result is that I decided that it was not a good idea to use a combo box bound to an integer (numeric) field.  I donu2019t think the SDK can handle it.  The reason it was an integer field in the first place is that before I changed it to a combo box it was a group of two option buttons.  Option buttons use an integer (numeric) field.  This worked just fine until I added a third option; the SDK didnu2019t handle the third option correctly when adding records.  I thought that using a combo box instead would fix that.  I was wrong; the problem remained.  So I decided to use a character (alphanumeric) field instead.  This works just fine.
    So here is my advice:  Never use option buttons if they need to be bound to the database; a combo box will actually work better when bound to the database.  But use a character (alphanumeric) field.
    Edited by: Mike Angelastro on Jul 5, 2009 9:15 PM

  • How to populate data in the data table on combo box change event

    hi
    i am deepak .
    i am very new to JSF.
    my problem is i want to populate data in the datatable on the combo box change event.
    for example ---
    combo box has name of the city. when i will select a city
    the details of the city should populate in the datatable. and if i will select another city then the datatable should change accordingly..
    its urgent
    reply as soon as possible
    thanks in advance

    i am using Rational Application Developer to develop my application.
    i am using a combo box and i am assigning cityName from the SDO.
    and i am declaring a variable in the pageCode eg.
    private String cityName;
    public void setCityName(String cityName){
    this.cityName = cityName;
    public String getCityName(){
    return cityName;
    <h:selectOneMenu id="menu1" styleClass="selectOneMenu" value="#{pc_Test1.loginID}" valueChangeListener="#{pc_Test1.handleMenu1ValueChange}">
                        <f:selectItems
                             value="#{selectitems.pc_Test1.usercombo.LOGINID.LOGINID.toArray}" />
                   </h:selectOneMenu>
                   <hx:behavior event="onchange" target="menu1" behaviorAction="get"
                        targetAction="box1"></hx:behavior>
    and also i am declaring a requestParam type variable named city;
    and at the onChangeEvent i am writing the code
    public void handleMenu1ValueChange(ValueChangeEvent valueChangedEvent) {
    FacesContext context = FacesContext.getCurrentInstance();
    Map requestScope = ext.getApplication().createValueBinding("#{requestScope}").getValue(context);
    requestScope.put("login",(String)valueChangedEvent.getNewValue());
    and also i am creating another SDO which is used to populate data in datatable and in this SDO in the where clause i am using that requestParam .
    it is assigning value in the pageCode variable and in the requestParam but it is not populating the dataTable. i don't no why??
    it is possible that i may not clear at this point.
    please send me the way how my problem can be solved.
    thanks in advance

  • Not able to populate data in the combo box

    Hi Guys,
    I m new to flex development and I want to populate the data
    coming from the databasein the combobox.I am able to get the length
    .but not able to populate the data.
    Can anyone helpme out?
    The code is below:
    The data displayed in the combox box is displayed as
    [object],[object] etc.I m sure that the data is coming from the
    database and its not populated in the combo box.any help is
    appreciated.
    private function getParkinfo(event:ResultEvent):void
    { Alert.show(event.result.length.toString());
    countries.dataProvider = event.result;
    <mx:ComboBox id="countries" />

    What does the data look like in the result? Is it XML? Post a
    sample of it.

  • Hide a data column in combo box?

    I want to load a combo box from a database with two values per row (add.Item ?) but I only want one value to be see by the end-user.
    Example:
    Hidden | Shown
    12320  |  Green
    19210  |  Red
    72622  |  Yellow
    The user will see the colors but not the numeric values. The numeric values are actually the auto_id for each color in the database. I want to use the auto_id when I save the user's choice to another table instead of the color name.
    Right now as soon as the use selects a color I hit the database for the auto_id number - that can't be good.
    Thanks,
    ADawn
    ADawn

    Hello,
    You would set the data source for the ComboBox that has your data then set DisplayMember to the field to show in the ComboBox along with ValueMember set to the hidden field. Now say in a button click event use ComboBox1.SelectedValue to get the hidden field,
    cast as an integer if that is the data type of the hidden field.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Load data in a combo box dynamically

    hello everybody!
    I need to load a combo box, depending on the selected data in another, eg by selecting the country and loaded societies selected country.
    Someone could guide whether this is possible, and if you have any examples that would be great.
    greetings

    user javascript events. "onload" and call some method so that it'll do your job(adding elements to combo).
    Edited by: Diablo_Chiru on May 15, 2008 4:35 AM

  • Need Help. Data jumps between Combo Boxes in an ADG

    I have an item renderer in an advanced datagrid.
    <mx:AdvancedDataGridColumn
        dataField="USE_TYPE_DESC"
        headerText="Use Type"
        rendererIsEditor="true"
        itemRenderer="renderers.tpUseTypeDropDown"
        editorDataField="getData"/>
    But the data that gets displayed in the combo boxes, appear to jump between CBs when you scroll the ADG up and down. The physical data is fine, its just the displayed data that is wrong.. Any ideas

    Ok, I tried this but still getting an error
    <cfquery datasource="mydb" name="test">
    Select name from mytable
    where
    <cfqueryparam value=#createodbcdate(edate)# cfsqltype="CF_SQL_DATE"> Between '01/01/2011' AND '01/01/2013'
    </cfquery>
    <cfoutput query="test">
    #ename#
    </cfoutput>
    now I get
    An error occurred while evaluating the expression:
    "#createodbcdate(edate)#"
    Error near line 3, column 53.
    Error resolving parameter EDATE

  • Setting Data Field of Combo Box

    I have a result set passed back as an Array. I want to set
    and reference a combo box with those values
    The first element in the array should be the data, the second
    should be the label
    I can get the label set, but i Cannot get and set the "data"
    the actually selected value.
    For example: my function is
    public function onResult_getSkillsetNames( result : Array ) :
    void
    skillsetName_cmb.dataProvider = result;
    skillsetName_cmb.labelField = "skillsetName";
    skillsetName_cmb.selectedItem = result[0];
    skillsetName_cmb.text = result[1];
    //skillsetName_cmb= results[0];

    Look this post.
    Combo Box dataField
    Support
    This may help you if you want to select another index than
    the index of the dataprovider.
    Best

  • Source Data option won't dispaly on combo box proprieties.

    I am trying to use combo box to dispaly a serie of data but when activated, the source data for the combo box is not available. Any idea what might be the problem and how can I resolve it?
    Thanks.

    The source data is not available for certain insert options as they do not need source data.
    These options are position, label and status list.
    If you switch to any of the other insert types, you can then bind your source data.

  • How do I retrieve data from combo boxes?

    The past weekend I spent my whole weekend trying to find this
    out and gone through the top 10 pages on google trying all sorts of
    things. I would be grateful for anyone who can help me.
    I have 6 combo boxes in a booking form and I need to retrieve
    the data when someone click submits which gets forwarded on to php
    then my mailbox. They are called box1_cb, box2_cb.....box6_cb All
    in the instance of: ComboBox - which I don't understand what that
    does.
    it does not seem to be retrieving any of the data. For each
    combo box:
    I have the the options people can choose form in "Labels" box
    under "Paramaters", nothing for "Data", Row Count is 8 and nothing
    for "Change Handler" which I don't know what it does.
    Can anyone please provide some help with telling me what
    "change handler" does, do I need the data for each combo box in the
    "Labels" parameter as well as the "Data" box, what an instance does
    (for combo boxes) and what I need to put in the actionscript for
    the submit button as well as do i need to put code in the
    actionscript for each combo box?
    The options people can choose from in the combo boxes are
    there when someone views the site.
    Can anyone please help me..I would greatly appriciate it.
    Thanks.

    If your hard drive can be detected and shows up as a drive letter in my computer but you can't access your files,then you can recover your data off it with data recovery software easily.This way is the easiest and the most inexpensive way to recover your data.If you bring it to a computer repair shop that is available for data recovery servise,they will cost you $500-1000 or more.Hmm, a lot of money.
    I managed to recover data from crashed hard drive with Tenorshare Data Recovery.If needed,you can download it and scan your hard drive for free to preview whether your data can be recovered.It will show you thumbnails for recoverable pictures.

  • To filter data in two dates using combo box component

    Hi,
    I have a requirement like, i need to filter data in chart between two dates from two combo box.. From combo_box and To combo_box.
    I am using one QaaWS to populate LOV's into Combo box's and another QaaWS for chart data. Universe is the same one on SAP  BI query.
    LOV's are populating into both combo's and chart as well, i used a query refresh button after choosing two dates and press button.
    Data is not reflecting as per the choice of dates.
    If any one have such scenario, request you to share the same....
    Thanks in advance...
    Raj..

    Problem is with ranges, not with dates, my data is working fine with CALDAY (in BI Query)....
    My query variable is on FiscalPeriod month, like "FEB 2011"  to "OCT 2011" and is optional, but it is fails in QaaWS to execute when i try to input any months.
    If we give default values in BI query format is like K4/010.2011 for october month. QaaWS doesnt fail and executes, but if i change any value in QaaWS it is taking as "OCT 2011"
    And in Xcelsius it is not recognizing eaither of the formats like, K4/010.2011 or "OCT 2011"
    the format is not matching with xcelsius.

  • Getting Dates using combo boxes

    I am trying to get a start date and an end date from a combo
    box. I have the following AS3 code but it doesn't work. startDay,
    startMonth etc are all comboboxes with appropriate data. Just can't
    figure the syntax to make it work.
    var start_date = new
    Date(startYear.selectedIndex,startMonth.selectedIndex,startDay.selectedIndex);
    var end_date = new
    Date(endYear.selectedIndex,endMonth.selectedIndex,endDay.selectedIndex);
    then i want to calculate and display the total days
    var nDiffDays = Math.floor((end_date - start_date)/86400000);
    totalDays_txt = nDiffDays;
    Any help appreciated.

    There are two of those controls: the drop down list and the combo box. Try the drop down list instead.

  • Plotting a combination chart with a combo box for selection

    Hi:
    I am a newbie using xcelcius and I need help on the following:-
    I need to create a combination chart that plots 3 years data by month, and I need a combo box selection at the top that allows me to select user display for each difference region. I manage to create one that plots only 2008 data with a combo-box selection, but I have no idea how to do it for a combi chart in xcelcius. Any advise?

    Hi Ning,
    I assume your data are like this:
    Region             Year     Jan     Feb     Mar
    APJ             2006     $234.45     $310.34     $321.54
    APJ             2007     $314.35     $319.12     $256.89
    APJ             2008     $425.54     $354.34     $285.73
    North Asia     2006     $534.64     $642.35     $484.64
    North Asia     2007     $631.74     $654.13     $754.34
    North Asia     2008     $754.31     $423.65     $634.32
    South East Asia     2006     $536.42     $576.35     $525.42
    South East Asia     2007     $426.78     $876.43     $643.75
    South East Asia     2008     $634.87     $425.77     $732.43
    If this, you can set the insertion type of combo box is "Filtered Rows", see steps:
    1) For Combo Box, bind General > Labels to the Region column.
    2) Set General > Data Insertion > Insertion Type is "Filtered Rows" (you can refer to following flash to see how "Filtered Rows" works).
    3) Set its Source Data are Year, Jan, Feb, ... columns and Destination to blank cells.
    4) Bind Chart to the destination data.
    Now when you select APJ from Combo Box, it will insert all the rows of APJ data to the desitination cells which will be displayed in Chart.
    Hope this can help!

  • Only Dimension Table Values in Combo Box or Drill Down Selections

    Hi All,
       How to get only Dimension Table Values instead of Master Data Values in Combo Box or Drill Down Box list of values?
    I am getting all the values in 0CALMONTH Combo Box where i need only infoproviders values.
    In Entry List tab of Combo Box when i select 0CALMONTH its reading from its Master Data.Is there any option how there is Dimension table in Value help.
    In Query, infoobject levels the filter values selection is set as infoprovider only.
    Can anyone please let me know how to get only dimension table values when we use combo box.
    Thanks & Regards
    K.Srinivas Rao

    Hi
    Create one BI query with only one object in the output of the query. (In your case 0CALMONTH)
    So now if when you run the query it will show values which are there in infoprovider. THen drag one form from output of this query in vc & create dropdown list on this.
    Is this what you are looking for?
    regards
    Sandeep

  • JTable & Combo Box

    Hello
    I have 2 combo box in the Jtable. Whenever there is something selected in the first drop down i have to repopulate the second combo box.
    JTable.populateData(ArrayList);
    Column renderer /editor
    TableColumn column1 = tablePane.getTable().getColumnModel().getColumn(
    1);
    columnn1.setCellEditor(new ComboBoxCellEditor(this));
    column1.setCellRenderer(new ComboBoxCellRenderer(this));
    TableColumn column2 = tablePane.getTable().getColumnModel().getColumn(
    2);
    column2.setCellEditor(new ComboBoxCellEditor(this));
    column2.setCellRenderer(new ComboBoxCellRenderer(this));
    How do i repopulate the data in 2nd combo box.

    It sounds like the combobox can be different for every row based on the value in another column in the row, therefore you need to dynamically change the editor for each row. This can be done by overriding the getCellEditor() method:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableComboBoxByRow extends JFrame
        ArrayList editors = new ArrayList(3);
        public TableComboBoxByRow()
            // Create the editors to be used for each row
            String[] items1 = { "Red", "Blue", "Green" };
            JComboBox comboBox1 = new JComboBox( items1 );
            DefaultCellEditor dce1 = new DefaultCellEditor( comboBox1 );
            editors.add( dce1 );
            String[] items2 = { "Circle", "Square", "Triangle" };
            JComboBox comboBox2 = new JComboBox( items2 );
            DefaultCellEditor dce2 = new DefaultCellEditor( comboBox2 );
            editors.add( dce2 );
            String[] items3 = { "Apple", "Orange", "Banana" };
            JComboBox comboBox3 = new JComboBox( items3 );
            DefaultCellEditor dce3 = new DefaultCellEditor( comboBox3 );
            editors.add( dce3 );
            //  Create the table with default data
            Object[][] data =
                 {"Color", "Red"},
                 {"Shape", "Square"},
                 {"Fruit", "Banana"},
                 {"Plain", "Text"}
            String[] columnNames = {"Type","Value"};
            DefaultTableModel model = new DefaultTableModel(data, columnNames);
            JTable table = new JTable(model)
                //  Determine editor to be used by row
                public TableCellEditor getCellEditor(int row, int column)
                    if (column == 1 && row < 3)
                        return (TableCellEditor)editors.get(row);
                    else
                        return super.getCellEditor(row, column);
            JScrollPane scrollPane = new JScrollPane( table );
            getContentPane().add( scrollPane );
        public static void main(String[] args)
            TableComboBoxByRow frame = new TableComboBoxByRow();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setVisible(true);
    }

Maybe you are looking for

  • My MBP's wifi is error! Please Help :(

    According to the topic, I've been using This macbook pro(mid 2009 model) since 2009 with OS Mavericks 10.9.4(most recently). It hasn't had any problems until yesterday. While I was using my mac with wifi network, it suddenly hanged and I cannot moved

  • Choosing Unique Values Generically and add respective data in Standard Input

    Hi, I want to send the unique data by generic checking and adding respective other data in case of Standard (X12) Input 850 Message. My Input : ISA*00* 00 *ZZ*THEM *ZZ*US 991221*1226*U*00401*000000025*0*T GS*PO*THEM*US*19991221*1226*1*X*004010 ST*850

  • Confirmation issues, Error in Process

    We are getting the following error in SRM system when doing confirmations, any ideas guys Error whilst creating an entry sheet in the backend system 0000026433 117 General error during acceptance posting This then dispays as an error in process??? Re

  • JPanel components too close together

    Hi! I have a JPanel with three components (JLabels) aligned vertically....but there are so close together...how can I put a space (like another line) between them? Thank you very much... Gen

  • Impact on import if there is a block corruption error in exported dump file

    Hi All I got an exported file(exp utility) from production database and in the log it is showing the error EXP-00056: ORACLE error 1578 encountered ORA-01578: ORACLE data block corrupted (file # 29, block # 387036) ORA-01110: data file 29: '+ORAFILES