Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > sorting a column with a space in the name in a data view
 

sorting a column with a space in the name in a data view

I have a dataview. It has a column "my col".
I want to sort by that...
dv.sort = "my col";
works
but
dv.sort = "my col DSC"; // or ASC
doesn't...
neither does
dv.sort = "'my col' DSC";
or
dv.sort = "\"my col\" DSC";

any one know how to tell it that the two words are the column name and the DSC is not part of the column name?
RandellP  Tuesday, July 28, 2009 10:01 PM

Not quotes... use brackets.

Also use DESC for descending.

  • Marked As Answer byRandellP Tuesday, July 28, 2009 10:47 PM
  •  
BinaryCoder  Tuesday, July 28, 2009 10:34 PM

Not quotes... use brackets.

Also use DESC for descending.

  • Marked As Answer byRandellP Tuesday, July 28, 2009 10:47 PM
  •  
BinaryCoder  Tuesday, July 28, 2009 10:34 PM
Worked perfectly... Thanks...

Randell
RandellP  Tuesday, July 28, 2009 10:47 PM

You can use google to search for other answers

Custom Search

More Threads

• DBConcurrencyException was unhandled
• combobox inside a DataGridView
• Can I reset, or replace the ReadOnly ColumnIndex property of the Datagridview.?
• Set SelectedValue ComboBox
• DataGridView Problem
• Gridview to Textbox
• button in datagrid
• restricting Data Grid navigation
• how to bind datareader to datagridview in vb.net2005
• DataMember Property 'FK_ChildTable_ParentTable' cannot be found on the DataSource