473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Getting sort error on datagrid column name

In VB .NET I load the contents of an Excel or comma seperated values file
into a dataGrid (via a datatable). One of the columns has a comma in the
name of the column. So for the comma separated values files I put double
quotes are the column name. What I see is that the name ends up getting
displayed correctly in the DataGrid column, "Class (1,2,3)". When I click
on the column to sort I see the following error:
"Additional information: [Class(1 isn't a valid Sort string entry"

Somehow the column name is being broken at the first comma. Is there a way
around this, does anyone know what's happening?
Nov 21 '05 #1
1 5281
EMW
If you use a dataview you can sort columns.

i.e. dim dv as new dataview(your table)
dv.sort = "column1 ASC"

you can also sort more then one column:
dv.sort = "column1, column2 ASC"

As you see it is comma separated.
I think clicking on the columnheader does something simulair as above, so if
you have comma's in your columnname, it will be looking for columns that are
not there.
You could put the numbers in single quotes?

i.e. "Class '(1,2,3)' "

I think it will help, but I'm not sure.

rg.
Eric

"nate axtell" <naxtell at progeny dot net> schreef in bericht
news:uu**************@TK2MSFTNGP12.phx.gbl...
In VB .NET I load the contents of an Excel or comma seperated values file
into a dataGrid (via a datatable). One of the columns has a comma in the
name of the column. So for the comma separated values files I put double
quotes are the column name. What I see is that the name ends up getting
displayed correctly in the DataGrid column, "Class (1,2,3)". When I click
on the column to sort I see the following error:
"Additional information: [Class(1 isn't a valid Sort string entry"

Somehow the column name is being broken at the first comma. Is there a
way
around this, does anyone know what's happening?

Nov 21 '05 #2

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

Similar topics

0
by: Elmar Grandel | last post by:
Hello, i just updated my mysql database from 4.0.x to 4.1 because i like to have the possibility to create subqueries. My problem with the new release is the following: In my running project i...
2
by: alan | last post by:
I set the datagrid to be sortable, sort expression = "Column1 asc" but when i click the column name the datagrid doesn't load anything, did i miss sth. on the sorting? thanks a lot!! in...
1
by: Andy L | last post by:
I have two identical databases running on two separate servers. I want to add a column to the following table: classified_cats { acid , name , parent } Running ALTER TABLE `classified_cats`...
2
by: gane | last post by:
Any ideas on how to assign value to a datagrid cell referencing the column name? I would like to assign a value to a datagrid item using the column name (from web.config file) instead of using...
0
by: ApoorvaDesai | last post by:
Boa constructor Windows XP python 2.3 How do you sort data alphabetically in the grid column. In one of the previous post i found a link...
3
by: kayclink | last post by:
hi, i am trying to generate a report through a record in a combo box but i get this error "invalid column name "DFG55FS" Please note "DFG55FS" is a record name in my combobox. please help i am...
3
nomad
by: nomad | last post by:
Hello everyone: I new to PHP and I'm reading a book on PHP Bibles 2nd edition. It has to deal with a user-rating system. There are 4 scripts to it. I'm getting an error Unknown column...
1
by: Nivedita Ambast | last post by:
I am creating a web apllication in asp(C#) on online leave management system. In a web page i created a gridview with linked button with text as "EMP_ID". On clicking to any id i want to get the...
1
by: Luis Mata | last post by:
I have a database. Im trying to change a column from MovieID to ArtistID. When i do that it gives me an error(Invalid column name 'MovieID'.) any suggestions to what can possibly be wrong?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.