Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Linq:  My code works but I donLinq: My code works but I don't know why.
Previous
 
Next
New Post
12/9/2008 12:00 PM
 

I was trying to write the LinqToSQL to call all tabs except ones starting with "Alphabet" (e.g. I don't want a page called "Apple", "Orange", "Strawberry", I want "+34", "(My Page)", "901 Emergency".)

where....first statement
and .....second statement
and... o.TabName.Substring(0,1) < "A"

This did work. HOWEVER, I really don't know why it works.  Could someone explain this? First I thought it's reading ascii value so I created a tab called "{Try This}" because "{" has a bigger ascii value than "A". I mean,,, even B has a bigger ascii value than "A".

[Adding Note:] I put "B" instead of "A", the tab names "Apple" & "ants" were included in the result.

 
New Post
12/9/2008 1:58 PM
 

My guess is that it is related to the string comparison functionality of .NET, I recommend doing some simple tests to see if the result is what you are looking for. 

Personally I would use <> rather than < to incidate not-equal.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
12/9/2008 2:14 PM
 

Use Sql Profiler and check what sql is generated by LinQToSql - then you can use SQLBooks Online to find out how the string comparison is working.


Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
12/9/2008 2:22 PM
 

Hello Mitch,

Here are the example tabs:

  • Apple
  • Banana
  • Cranberry
  • Donuts
  • Elephants
  • @my Home
  • (I love this page)
  • {GreatPage}

If I use "<", it returns this: (EXACTLY WHAT I WANT) 

  • Apple
  • Banana
  • Cranberry
  • Donuts
  • Elephants

If i use <>, the result returns following:

  • Banana
  • Cranberry
  • Donuts
  • Elephants
  • @my Home
  • (I love this page)
  • {GreatPage}

If i use ">", it returns following:

  • Banana
  • Cranberry
  • Donuts
  • Elephants

I just .... don't know if i can sleep tonight without solving this lol. that's all.

 
New Post
12/9/2008 2:27 PM
 

Thank you Charles! I'll try that.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Linq:  My code works but I donLinq: My code works but I don't know why.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out