473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DataBinder.Eval and fields with a dot in the name

Hello,

I am trying to bind a DataGrid with some data from a DataSet which
contains fields in the form "group.fieldname". I am certain that my
data source contains the field but I cannot get my head around which
syntax to use when specifying which field to bind to the DataGrid.

I have tried

<%# DataBinder.Eval( Container.DataItem, "Group.FieldName" ) %>

and

<%# DataBinder.Eval( Container.DataItem, "[Group.FieldName]" %> which
is just plain old wrong :)

Can any one help me out here?

--
Med venlig hilsen,
Søren Lund
http://www.publicvoid.dk
Nov 18 '05 #1
4 2471
hi Søren Lund,

text='<%#DataBinder.Eval(Container.DataItem, "Desc")%>'

you need to give the name of the field.

HTH
Regards
Ashish M Bhonkiya
"Søren Lund" <mu****@hotmail.com> wrote in message
news:xn***************@news.microsoft.com...
Hello,

I am trying to bind a DataGrid with some data from a DataSet which
contains fields in the form "group.fieldname". I am certain that my
data source contains the field but I cannot get my head around which
syntax to use when specifying which field to bind to the DataGrid.

I have tried

<%# DataBinder.Eval( Container.DataItem, "Group.FieldName" ) %>

and

<%# DataBinder.Eval( Container.DataItem, "[Group.FieldName]" %> which
is just plain old wrong :)

Can any one help me out here?

--
Med venlig hilsen,
Søren Lund
http://www.publicvoid.dk

Nov 18 '05 #2
is the datasource a custom collection or is Group.FieldName one of your
columns in the db?

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET)
Microsoft Certified Application Developer (.NET)
http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"Søren Lund" <mu****@hotmail.com> wrote in message
news:xn***************@news.microsoft.com...
Hello,

I am trying to bind a DataGrid with some data from a DataSet which
contains fields in the form "group.fieldname". I am certain that my
data source contains the field but I cannot get my head around which
syntax to use when specifying which field to bind to the DataGrid.

I have tried

<%# DataBinder.Eval( Container.DataItem, "Group.FieldName" ) %>

and

<%# DataBinder.Eval( Container.DataItem, "[Group.FieldName]" %> which
is just plain old wrong :)

Can any one help me out here?

--
Med venlig hilsen,
Søren Lund
http://www.publicvoid.dk

Nov 18 '05 #3
Swanand Mokashi wrote:
is the datasource a custom collection or is Group.FieldName one of
your columns in the db?


The field is from a standard dataset which has been populated through a
custom oledb provider (a Commerce Server provider if that is any help
to you).

--
Med venlig hilsen,
Søren Lund
http://www.publicvoid.dk
Nov 18 '05 #4
Ashish M Bhonkiya wrote:

Yes I know, the problem is that the databinder returns an error if I
specify that name with a dot in it. My fields are named
"blabla.theotherthing" which throws an exception at runtime, like this:

DataBinder.Eval: 'System.Data.DataRowView' does not contain a property
with the name GeneralInfo.

Notice ths dot at the end of the exception, the field is actually named
GeneralInfo.logon_name. It seems to me that the databinder stops
processing when it reaches the dot even though there's more of the name
left? Kinda weird.

Also I am able to bind the data to the DataGrid if I AutoGenerate the
columns of the DataGrid but that's really not what I am looking for.

text='<%#DataBinder.Eval(Container.DataItem, "Desc")%>'

you need to give the name of the field.

I am trying to bind a DataGrid with some data from a DataSet which
contains fields in the form "group.fieldname". I am certain that my
data source contains the field but I cannot get my head around which
syntax to use when specifying which field to bind to the DataGrid.

I have tried

<%# DataBinder.Eval( Container.DataItem, "Group.FieldName" ) %>

and

<%# DataBinder.Eval( Container.DataItem, "[Group.FieldName]" %>
which is just plain old wrong :)

Can any one help me out here?

--
Med venlig hilsen,
Søren Lund
http://www.publicvoid.dk
Nov 18 '05 #5

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

Similar topics

0
by: Michelle Keys | last post by:
Subject: DataBinder.Eval Error! Server Error in '/MSPOS' Application. ------------------------------------------------------------------------ -------- DataBinder.Eval:...
1
by: A Ratcliffe | last post by:
Although at the moment, I have a couple of large classic ASP projects on the go, when I need to take a break, I'm experimenting with ASP.NET (with both VB.NET and C#). I notice that most...
0
by: Lauchlan M | last post by:
Hi In my aspx page HTML I have <a href='<%# DataBinder.Eval(Container.DataItem, "Name") %>'> <%# DataBinder.Eval(Container.DataItem, "Name") %> I am trying to create a hyperlink to...
2
by: Tom Lee | last post by:
Hi all, I have the following problem and I cannot solve it. If anyone can help me solve this problem. I use the following code <%#DataBinder.Eval(Container.DataItem, "Property")%> to display...
5
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash...
1
by: Mike Lerch | last post by:
Pretty much, TSIA, but I'll expand a bit: I'm still trying to get my head around the n-tier approach to web design. It seems to me that when you use DataBinder.Eval in the ASPX that your tiers...
4
by: Pierre Shirvan | last post by:
I have a form with a DataList control with a label control and a text control in the ItemTemplate section. I can display the data in the text contol using the DataBinder.Eval method and I also want...
8
by: Randall Parker | last post by:
I want to generate an HTML tag that will look like: <a href="EquipmentServiceCreate.aspx?serial=X01">Create New Service For X01</a> or on a different instance where the user would be viewing...
4
by: CharlesA | last post by:
a general question... I'm a bit mystified by Databinder.eval(object, Colname, ) if controls can be bound to their individual data sources within the load event of the page... why would we ever...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.