473,698 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why all Female

ad

I convert the field to a template column and then use a tmeplate expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ? "Male":"Female" %>

Why the value always equal Female
(This method is from Rick Strahl)
Nov 17 '05 #1
10 1494
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ?
"Male":"Female" %>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #2
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ?
"Male":"Female" %>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #3
Very funny, however your reply did nothing to help the OP. Perhaps you can
demostrate your assertion by posting an 'Answer' which may help the OP?
--
OHM ( Terry Burns )

http://TrainingOn.net



"Stephany Young" <noone@localhos t> wrote in message
news:ul******** ********@TK2MSF TNGP12.phx.gbl. ..
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ?
"Male":"Female" %>

Why the value always equal Female
(This method is from Rick Strahl)


Nov 17 '05 #4
Very funny, however your reply did nothing to help the OP. Perhaps you can
demostrate your assertion by posting an 'Answer' which may help the OP?
--
OHM ( Terry Burns )

http://TrainingOn.net



"Stephany Young" <noone@localhos t> wrote in message
news:ul******** ********@TK2MSF TNGP12.phx.gbl. ..
Because the female is superior to the male :)
"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ?
"Male":"Female" %>

Why the value always equal Female
(This method is from Rick Strahl)


Nov 17 '05 #5
Ad,

Why don't you change it in your program to:
<%# (DataBinder.Eva l(Container, "DataItem.SexID ")).ToString()% >

Than you would see it in my opinion

Although woman are of course superior to man, should this not a reason that
they can do it without them.

Cor

Nov 17 '05 #6
Ad,

Why don't you change it in your program to:
<%# (DataBinder.Eva l(Container, "DataItem.SexID ")).ToString()% >

Than you would see it in my opinion

Although woman are of course superior to man, should this not a reason that
they can do it without them.

Cor

Nov 17 '05 #7
This is beecause the value is never "1". If it's a boolean item in the
dataset the response is probably "true" or "false" but don't rule out the
possibilities of "yes" or "no".

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ?
"Male":"Female" %>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #8
This is beecause the value is never "1". If it's a boolean item in the
dataset the response is probably "true" or "false" but don't rule out the
possibilities of "yes" or "no".

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"ad" <ad@wfes.tcc.ed u.tw> wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...

I convert the field to a template column and then use a tmeplate
expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ?
"Male":"Female" %>

Why the value always equal Female
(This method is from Rick Strahl)

Nov 17 '05 #9
ad <ad@wfes.tcc.ed u.tw> wrote:

I convert the field to a template column and then use a tmeplate expression
like this:

<%# (DataBinder.Eva l(Container, "DataItem.SexID "))=="1" ? "Male":"Female" %>

Why the value always equal Female


DataBinder.Eval (object, string) is an expression of type object, so
you're performing a reference identity comparison against the string
literal "1". If you use

"1".Equals(Data Binder.Eval (Container, DataItem.SexID" ))
?"Male":"Female "

you may well find it works. Or not, depending on whether the evaluation
actually returns a string or not...

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #10

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

Similar topics

0
247
by: ad | last post by:
I convert the field to a template column and then use a tmeplate expression like this: <%# (DataBinder.Eval(Container, "DataItem.SexID"))=="1" ? "Male":"Female"%> Why the value always equal Female (This method is from Rick Strahl)
22
22341
by: campbellbrian2001 | last post by:
Thanks in Advance! ... I have two textboxes: 1 is visible (and gets its value based on the invisible textbox and displays either "Male" or "Female", and needs to display either male of female based on the value that comes up in the tables record as "M" or "F". I tried: =Iff((!)="M","Male","Female") 'the is form, is the textbox name
18
1398
by: strangerdream | last post by:
I'm a lurker here, and I do not find any female regulars here in c.l.c. Is it something thats got to do with their genes?
0
867
by: smifti | last post by:
Any Pakistani (Region: Khi) Female Professional Web Designer who use Asp.Net using C#, Plz! contact me 03452884141. thanks & best regards smifti - khi
0
8668
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9152
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6515
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4358
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3037
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
2
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1995
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.