Click here to Skip to main content
15,916,091 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalprogress bar Pin
WartHog00017-Dec-04 14:19
WartHog00017-Dec-04 14:19 
GeneralRe: progress bar Pin
Mekong River18-Dec-04 5:41
Mekong River18-Dec-04 5:41 
GeneralRe: progress bar Pin
WartHog00018-Dec-04 7:04
WartHog00018-Dec-04 7:04 
GeneralDatabase -- What am i not understanding. Pin
OICU81217-Dec-04 12:21
OICU81217-Dec-04 12:21 
GeneralRe: Database -- What am i not understanding. Pin
Dave Kreskowiak17-Dec-04 14:14
mveDave Kreskowiak17-Dec-04 14:14 
GeneralRe: Database -- What am i not understanding. Pin
OICU81217-Dec-04 18:57
OICU81217-Dec-04 18:57 
GeneralBitmaps and GDI+ Pin
Michael Parkin17-Dec-04 10:10
Michael Parkin17-Dec-04 10:10 
Generalcustom sorting datatables Pin
mfriedenthal17-Dec-04 8:07
sussmfriedenthal17-Dec-04 8:07 
Please note that I am a beginner VB.net programmer. Any help you can offer would be appreciated.

I am trying to sort a datatable loaded from an SQL db table. There are 2 sort keys, both ascending, and 9 other columns. The primary key, "PurchaseOrderID", can contain nulls, although it is usually a string of format "999999_999". After loading the ds, I use the following code to try to sort the records:

Dim myDataView As DataView
myDataView = ds.Tables("tPIA").DefaultView
myDataView.Sort = ("PurchaseOrderID, TimeNeeded")


The problem is I need the rows with null values in PurchaseOrderID to all sort to the high end. I know one can write a custom comparer to modify sort order but I haven't seen the syntax of how one can use a comparer with a dataview.

Can this be done? If so, what's the syntax?

If not, do you have any other suggestions? I originally loaded the SQL table into a Collection but there didn't seem to be a sort method available there. So I loaded the Collection into an array and wrote a custom comparer, but then I couldn't seem to sort on the 2 fields, as required.

Thank you,
mif


mif
GeneralRe: custom sorting datatables Pin
OICU81217-Dec-04 11:23
OICU81217-Dec-04 11:23 
GeneralRe: custom sorting datatables Pin
LadyReader20-Dec-04 4:41
LadyReader20-Dec-04 4:41 
GeneralRe: custom sorting datatables Pin
OICU81221-Dec-04 21:13
OICU81221-Dec-04 21:13 
GeneralRe: custom sorting datatables Pin
LadyReader22-Dec-04 4:16
LadyReader22-Dec-04 4:16 
GeneralCheck the file os open or not in vb Pin
Member 158672017-Dec-04 3:18
Member 158672017-Dec-04 3:18 
GeneralRe: Check the file os open or not in vb Pin
Dave Kreskowiak17-Dec-04 6:13
mveDave Kreskowiak17-Dec-04 6:13 
GeneralMaking Monitor Black Pin
Member 158672017-Dec-04 2:50
Member 158672017-Dec-04 2:50 
GeneralRe: Making Monitor Black Pin
Dave Kreskowiak17-Dec-04 6:00
mveDave Kreskowiak17-Dec-04 6:00 
GeneralRe: Making Monitor Black Pin
Member 158672017-Dec-04 14:23
Member 158672017-Dec-04 14:23 
GeneralRe: Making Monitor Black Pin
OICU81217-Dec-04 19:29
OICU81217-Dec-04 19:29 
GeneralRe: Making Monitor Black Pin
Dave Kreskowiak18-Dec-04 4:37
mveDave Kreskowiak18-Dec-04 4:37 
GeneralHelp with Browse Pin
mex_young17-Dec-04 1:04
mex_young17-Dec-04 1:04 
GeneralRe: Help with Browse Pin
Purple Monk17-Dec-04 4:45
Purple Monk17-Dec-04 4:45 
GeneralRe: Help with Browse Pin
mex_young17-Dec-04 23:23
mex_young17-Dec-04 23:23 
GeneralHelp !! Event not Raise in VB.net Pin
stv17-Dec-04 0:36
stv17-Dec-04 0:36 
GeneralRe: Help !! Event not Raise in VB.net Pin
OICU81217-Dec-04 5:38
OICU81217-Dec-04 5:38 
GeneralFTP Pin
nitin_ion17-Dec-04 0:27
nitin_ion17-Dec-04 0:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.