Question sql not sorting

Gideon

Member
Joined
Aug 31, 2015
Messages
8
Programming Experience
Beginner
I have the following code in an vb.net application :

opdragsorteer.Connection = konneksie
opdragsorteer.CommandText = "SELECT * FROM Ontledings ORDER BY AREA DESC"
opdragsorteer.ExecuteNonQuery()

However it does not sort the sql table.

Any help would be appreciated.

Regards
 

Herman

Well-known member
Joined
Oct 18, 2011
Messages
882
Location
Montreal, QC, CA
Programming Experience
10+
What do you mean by sort the table? This query returns a data set sorted by area descending, it doesn't sort the table. There is no point in sorting indexed data.
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
I have the following code in an vb.net application :

opdragsorteer.Connection = konneksie
opdragsorteer.CommandText = "SELECT * FROM Ontledings ORDER BY AREA DESC"
opdragsorteer.ExecuteNonQuery()

However it does not sort the sql table.

Any help would be appreciated.

Regards
What do you mean it does not sort the table?
When you get the data out of the table is it sorted by [Area] in descending order?
If so, then the query is working as expected. If not, then what does your data look like? What are you trying to achieve?
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
@Juggalo

Judging from ExecuteNonQuery I think the OP is just confused about how SQL works...
Good catch, he's gonna have a lot of problems viewing his data if he's not even capturing the results from the database in his program.
 
Top Bottom