Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Binding two data columns to DataTextField

Reply
Thread Tools

Binding two data columns to DataTextField

 
 
Angela
Guest
Posts: n/a
 
      06-07-2004
Hi everyone,

Is it possible to bind the DataTextField property to two values from a
database.

I would like the text from column("book") and the text from
column("code") to appear in the DataTextField of a dropdown.

If this is not possible is there are work around?


Thanks


Angela
 
Reply With Quote
 
 
 
 
Ben
Guest
Posts: n/a
 
      06-07-2004
I'm sure there are many approaches to this, but I would do it inside
OnItemDataBind. Create a datarowview, and process information as necessary.
"Angela" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi everyone,
>
> Is it possible to bind the DataTextField property to two values from a
> database.
>
> I would like the text from column("book") and the text from
> column("code") to appear in the DataTextField of a dropdown.
>
> If this is not possible is there are work around?
>
>
> Thanks
>
>
> Angela




 
Reply With Quote
 
 
 
 
David Wier
Guest
Posts: n/a
 
      06-07-2004
You can accomplish this easily by creating the item displayed in your SQL
statement:
Select book + ' ' + code as BookCode from (YourTableName)
Then, use 'BookCode' as your DataTextField

David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com


"Angela" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi everyone,
>
> Is it possible to bind the DataTextField property to two values from a
> database.
>
> I would like the text from column("book") and the text from
> column("code") to appear in the DataTextField of a dropdown.
>
> If this is not possible is there are work around?
>
>
> Thanks
>
>
> Angela



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dropdownlist: 2 columns in the DataTextField nicholas ASP .Net 5 12-03-2004 06:25 PM
Binding two columns to a DropDownList Simon Harvey ASP .Net 1 06-27-2004 03:35 AM
Binding Image data type columns Paul Turley ASP .Net Web Controls 1 05-19-2004 02:46 AM
Binding Two DataTable Columns to One DataGrid Column quiggle ASP .Net Datagrid Control 0 04-02-2004 04:12 PM
binding data to datagrid(template columns) Daniel Caetano ASP .Net Datagrid Control 0 02-27-2004 08:00 PM



Advertisments