Home All Groups Group Topic Archive Search About

Problem in populating 3 data from database in ddl.DataTextField.

Author
22 Jul 2005 6:43 PM
Joey Liang via DotNetMonster.com
Hi all,
        I hav figure out how to populate more than one data retrieved from
database and bind to dropdownlist.DataTextField for quite a long time but
unable to figure it out. I need you guys help and advice..Is it possible to
do that? really hope u guys can help me..Thanx in advance.

This is what i want to do :
1. A Saved Credit Card Dropdownlist with Credit Card Type Info, Credit Card
Number, Expiry Date retrieved from the database and
    bound in one selected item. In other words the dropdownlist.DataTextField
have 3 data from database and bound it to one
    DatatextField.

   Example :  MasterCard-xxxxxxxxxxxx1234-07/2006   
                   VisaCard-xxxxxxxxxxxx1234-03/2008

This is how it looks forthe Saved Credit Card drop down list that i want.Is
it possible to do it? I only know how to populate one data in one
tadaTextfield. If is possible can hav source code example or any articles
regarding this? Thanx...


--
Message posted via http://www.dotnetmonster.com

Author
28 Jul 2005 2:36 AM
Steve Lutz
I'm assuming that this data is comming from a database and you are
populating a dataset?

When you are selecting the data from the database, add an additional column
that concatenates the data you want, for example:
    select cctype, ccnum, ccexp, cctype + ' ' + ccnum + ' ' + ccext as
UserDisplayColumn from credit_cards

Then set your DateTextField to be the UserDisplayColumn.

The other option is to add a column to the dataset, then fill it in, but
this is not as easy as the above method.

HTH

Steve


Show quoteHide quote
"Joey Liang via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:51B676A2888EA@DotNetMonster.com...
>
> Hi all,
>        I hav figure out how to populate more than one data retrieved from
> database and bind to dropdownlist.DataTextField for quite a long time but
> unable to figure it out. I need you guys help and advice..Is it possible
> to
> do that? really hope u guys can help me..Thanx in advance.
>
> This is what i want to do :
> 1. A Saved Credit Card Dropdownlist with Credit Card Type Info, Credit
> Card
> Number, Expiry Date retrieved from the database and
>    bound in one selected item. In other words the
> dropdownlist.DataTextField
> have 3 data from database and bound it to one
>    DatatextField.
>
>   Example :  MasterCard-xxxxxxxxxxxx1234-07/2006
>                   VisaCard-xxxxxxxxxxxx1234-03/2008
>
> This is how it looks forthe Saved Credit Card drop down list that i
> want.Is
> it possible to do it? I only know how to populate one data in one
> tadaTextfield. If is possible can hav source code example or any articles
> regarding this? Thanx...
>
>
> --
> Message posted via http://www.dotnetmonster.com