473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Multiple Databinding Values In The Same Property

I have two fields in a DataSet that I want to use in the same property.
These fields are the first and last names which I want to assign to the Text
property of a Label. I can assign either one of them to the Text property as
follows:

text='<%# DataBinder.Eval (Container,"Dat aItem.membernam es.lname") %>'

OR

text='<%# DataBinder.Eval (Container,"Dat aItem.membernam es.fname") %>'
Either one of these will correctly display the expected value, but I need to
combine them so that both values are displayed together. How can I do this?
Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
1 991
<%# DataBinder.Eval (Container,"Dat aItem.membernam es.fname") + " " +
DataBinder.Eval (Container,"Dat aItem.membernam es.lname") %>

for more advance dstuff, you can hook into the OnItemDataBound event.

You can learn more about all of this at:
http://openmymind.net/index.aspx?documentId=8#4

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:OR******** ******@TK2MSFTN GP14.phx.gbl...
I have two fields in a DataSet that I want to use in the same property.
These fields are the first and last names which I want to assign to the
Text property of a Label. I can assign either one of them to the Text
property as follows:

text='<%# DataBinder.Eval (Container,"Dat aItem.membernam es.lname") %>'

OR

text='<%# DataBinder.Eval (Container,"Dat aItem.membernam es.fname") %>'
Either one of these will correctly display the expected value, but I need
to combine them so that both values are displayed together. How can I do
this? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1104
by: Nathan Sokalski | last post by:
I have two fields in a DataSet that I want to use in the same property. These fields are the first and last names which I want to assign to the Text property of a Label. I can assign either one of them to the Text property as follows: text='<%# DataBinder.Eval(Container,"DataItem.membernames.lname") %>' OR text='<%#...
2
1593
by: ECathell | last post by:
'------------------------------------------------------------------------------------------------ 'Label Formats '------------------------------------------------------------------------------------------------ Me.cboLabelFormat1.DataSource = mLabelFormatsCollection Me.cboLabelFormat1.DisplayMember = "FormatName"...
7
2573
by: Pieter | last post by:
Hi, I'm looking for a DateTimePicker that supports 100% databinding (and support null-values)... It's a shame that the normal control doesn't, but when searching on the internet, I didn't find any solution that works without problems. Does anybody know where I can find an inherited DateTimePicker that supports databinding and...
1
1006
by: avf | last post by:
hi all. in my code i bind a few dropdownlist boxes's lists, datasource etc. i bind the Selectedvalue property, and everything is fine. then one bright day, WITHOUT ANY CHANGE TO THE DATABINDING CODE, i started getting "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values". in the IDE i see that scewy...
0
1278
by: clickon | last post by:
I want to use an INSERT Query as the value for the UpdateCommand property of an SQL datasource, anyone know if this will actually work ? The reason i want to do it is bacause i am taking values from tablea and binding them to controls, whose values i want to insert into tableb. I am using a detailsview control to do the databinding. If the...
53
4638
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code, and .Net2005 code. I'm developing in vb.net 2005. This test sub just reads an input text file, writing out records to another text file, eliminating...
1
1621
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello to all, I want to know if DataBinding in asp.net 2,0 is better than to fill up the values of the controls of the following form: this.miControlTextBox.Text = valorParaControlTextbox; Performance with databinding is good in asp.net 2.0 ? Would you prefer: databinding or set value to Text property of control ?
2
3246
by: cjard | last post by:
I ask, because I have a textbox bound to a bindingsource, which is bound to a datatable(row) The datatable is typed, and hence exports a Property called Column1 I added another property to the datatable by editing the partial class, and Called it ColumnX - it simply returns "Hello World" all the time Then I tried to bind my textbox to...
4
3308
by: Jason Wolf | last post by:
I have an object which runs in a sperate thread, from the main thread, and while running it updates a public property. In my main form I defined databinding on the property and I would like to see this databinding update my form property to reflect the value of the other components property, but it does not happen. My binding is...
7
13521
by: JTC^..^ | last post by:
When i attempt to bind to the "Text" and "Value" property of a combobox on a windows form the value is reset when I leave the combobox. The comboboxes contain the correct Text and Values. I know this as the Value property binds correctly on it own. It is only when I bind the "Text" and "Value" that the issue occurs. The following sample...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.