DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 11 Jul 2007 19:58:03 -0600,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    Ronald S. Cook
          2    Sergey Poberezovskiy


How write SQL's "ISNULL(ThemeRank, 255)" instead in ADO.NET when sorting DataView?   
In SQL, I can write:

SELECT *
FROM Product
ORDER BY ISNULL(ProductRank,255)

To return:

Alpha       1
Delta        2
Golf         3
Foxtrot    4
Charlie    5
Echo       NULL
Bravo     NULL


But how can I do this in ADO.NET in a DataView?  Right now I just have:

view.Sort = "ThemeRank ASC";

I tried:

view.Sort = "ISNULL(ThemeRank, 255)";

but that didn't do the trick.

Any help would be greatly appreciated.

Thanks,
Ron
Date:Wed, 11 Jul 2007 19:58:03 -0600   Author:  

RE: How write SQL's "ISNULL(ThemeRank, 255)" instead in ADO.NET when s   
Ron,

you will need to create a calculated column that is the result of your 
function in order to be able to sort on it, for example:

view.Table.Columns.Add("Calculated", typeof(int), "IsNull(ThemeRank, 255)");
view.Sort = "Calculated";


"Ronald S. Cook" wrote:


> In SQL, I can write:
> 
> SELECT *
> FROM Product
> ORDER BY ISNULL(ProductRank,255)
> 
> To return:
> 
> Alpha       1
> Delta        2
> Golf         3
> Foxtrot    4
> Charlie    5
> Echo       NULL
> Bravo     NULL
> 
> 
> But how can I do this in ADO.NET in a DataView?  Right now I just have:
> 
> view.Sort = "ThemeRank ASC";
> 
> I tried:
> 
> view.Sort = "ISNULL(ThemeRank, 255)";
> 
> but that didn't do the trick.
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> Ron
> 
> 
> 
> 
> 
Date:Wed, 11 Jul 2007 20:22:02 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us