473,471 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Order by Clause....

I am creating a table object inside a dataset and attaching that to the

datagrid.

DataGrid1.DataSource = myDataset.Tables("myTable")

DataGrid1.DataBind()

Is there anyway before I bind the data to the grid can I sort the data
defining a column.

Like order by criteria in SQL.

Thanks,

Smith
Nov 19 '05 #1
7 1270
dim dv as DataView = myDataSet.Tables("myTable")
dv.Sort = "MyColumn ASC"
DataGrid1.DataSource = dv
DataGrid1.DataBind()

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
I am creating a table object inside a dataset and attaching that to the

datagrid.

DataGrid1.DataSource = myDataset.Tables("myTable")

DataGrid1.DataBind()

Is there anyway before I bind the data to the grid can I sort the data
defining a column.

Like order by criteria in SQL.

Thanks,

Smith

Nov 19 '05 #2
Thank you Karl for the soultion.
This step involves converting the data to dataview which involves few CPU
cycles.
Before implementing this I want to make sure there is no other method which
is build in the dataset or dataset table is available.
Thanks,
Smith

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uu**************@TK2MSFTNGP12.phx.gbl...
dim dv as DataView = myDataSet.Tables("myTable")
dv.Sort = "MyColumn ASC"
DataGrid1.DataSource = dv
DataGrid1.DataBind()

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
I am creating a table object inside a dataset and attaching that to the

datagrid.

DataGrid1.DataSource = myDataset.Tables("myTable")

DataGrid1.DataBind()

Is there anyway before I bind the data to the grid can I sort the data
defining a column.

Like order by criteria in SQL.

Thanks,

Smith


Nov 19 '05 #3
I have set Option Explicit On
I am getting the error for the below line.
dim dv as DataView = myDataSet.Tables("myTable")

I am using .Net Framework 1.1.
Please advice.
Thanks
Smith
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uu**************@TK2MSFTNGP12.phx.gbl...
dim dv as DataView = myDataSet.Tables("myTable")
dv.Sort = "MyColumn ASC"
DataGrid1.DataSource = dv
DataGrid1.DataBind()

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
I am creating a table object inside a dataset and attaching that to the

datagrid.

DataGrid1.DataSource = myDataset.Tables("myTable")

DataGrid1.DataBind()

Is there anyway before I bind the data to the grid can I sort the data
defining a column.

Like order by criteria in SQL.

Thanks,

Smith


Nov 19 '05 #4
Oopss...

dim dv as dataview = myDataSet.TAbles("myTable").DefaultView

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:OE**************@TK2MSFTNGP15.phx.gbl...
I have set Option Explicit On
I am getting the error for the below line.
dim dv as DataView = myDataSet.Tables("myTable")

I am using .Net Framework 1.1.
Please advice.
Thanks
Smith
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uu**************@TK2MSFTNGP12.phx.gbl...
dim dv as DataView = myDataSet.Tables("myTable")
dv.Sort = "MyColumn ASC"
DataGrid1.DataSource = dv
DataGrid1.DataBind()

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
I am creating a table object inside a dataset and attaching that to the
datagrid.

DataGrid1.DataSource = myDataset.Tables("myTable")

DataGrid1.DataBind()

Is there anyway before I bind the data to the grid can I sort the data
defining a column.

Like order by criteria in SQL.

Thanks,

Smith



Nov 19 '05 #5
heh..cpu cycles....those couple milliseconds will really come back to haunt
you....well, rest assured, when you do XXXXX.DataSource = DataSet/DataTable,
it automatically fetches the DefaultView from those (ie, you are always
binding to a DataView), so there is no performance penalty. Frankly, you
want things to be ordered but don't expect to spend any cpu cycles doing it?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Thank you Karl for the soultion.
This step involves converting the data to dataview which involves few CPU
cycles.
Before implementing this I want to make sure there is no other method which is build in the dataset or dataset table is available.
Thanks,
Smith

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uu**************@TK2MSFTNGP12.phx.gbl...
dim dv as DataView = myDataSet.Tables("myTable")
dv.Sort = "MyColumn ASC"
DataGrid1.DataSource = dv
DataGrid1.DataBind()

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
I am creating a table object inside a dataset and attaching that to the
datagrid.

DataGrid1.DataSource = myDataset.Tables("myTable")

DataGrid1.DataBind()

Is there anyway before I bind the data to the grid can I sort the data
defining a column.

Like order by criteria in SQL.

Thanks,

Smith



Nov 19 '05 #6
Karl,
Thanks for the answer.
Smith

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:#I**************@TK2MSFTNGP10.phx.gbl...
heh..cpu cycles....those couple milliseconds will really come back to haunt you....well, rest assured, when you do XXXXX.DataSource = DataSet/DataTable, it automatically fetches the DefaultView from those (ie, you are always
binding to a DataView), so there is no performance penalty. Frankly, you
want things to be ordered but don't expect to spend any cpu cycles doing it?
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Thank you Karl for the soultion.
This step involves converting the data to dataview which involves few CPU
cycles.
Before implementing this I want to make sure there is no other method

which
is build in the dataset or dataset table is available.
Thanks,
Smith

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uu**************@TK2MSFTNGP12.phx.gbl...
dim dv as DataView = myDataSet.Tables("myTable")
dv.Sort = "MyColumn ASC"
DataGrid1.DataSource = dv
DataGrid1.DataBind()

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
> I am creating a table object inside a dataset and attaching that to

the >
> datagrid.
>
>
>
> DataGrid1.DataSource = myDataset.Tables("myTable")
>
> DataGrid1.DataBind()
>
>
>
> Is there anyway before I bind the data to the grid can I sort the data > defining a column.
>
> Like order by criteria in SQL.
>
> Thanks,
>
> Smith
>
>



Nov 19 '05 #7
Karl,
This worked well for me.
Thanks.
Smith
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:ei**************@TK2MSFTNGP09.phx.gbl...
Oopss...

dim dv as dataview = myDataSet.TAbles("myTable").DefaultView

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:OE**************@TK2MSFTNGP15.phx.gbl...
I have set Option Explicit On
I am getting the error for the below line.
dim dv as DataView = myDataSet.Tables("myTable")

I am using .Net Framework 1.1.
Please advice.
Thanks
Smith
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uu**************@TK2MSFTNGP12.phx.gbl...
dim dv as DataView = myDataSet.Tables("myTable")
dv.Sort = "MyColumn ASC"
DataGrid1.DataSource = dv
DataGrid1.DataBind()

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Smith John" <Jo*********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
> I am creating a table object inside a dataset and attaching that to the >
> datagrid.
>
>
>
> DataGrid1.DataSource = myDataset.Tables("myTable")
>
> DataGrid1.DataBind()
>
>
>
> Is there anyway before I bind the data to the grid can I sort the data > defining a column.
>
> Like order by criteria in SQL.
>
> Thanks,
>
> Smith
>
>



Nov 19 '05 #8

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

Similar topics

1
by: M Wells | last post by:
Hi all, Just wondering if anyone can tell me if an order by clause on a select query would have any impact on the time it takes to retrieve results? Essentially I'm selecting Top 1 out of a...
3
by: Blake Caraway | last post by:
All, I've seen several posts regarding using UNION or UNION ALL to mash together two or more resultsets into a single result set, but can't seem to find enough info here to help me answer my...
7
by: JJ_377 | last post by:
Can someone tell me why SQL seems to ignore my order by clause? I tried to run through the debugger, but the debugger stops at the select statement line and then returns the result set; so, I have...
1
by: mailar | last post by:
Hi, Can I use ORDER BY clause in my sql UDF that returns a table and has the folloing body. (trial_udf.sql) drop function aa@ create function aa() returns TABLE(empno varchar(20)) language...
12
by: Jozef | last post by:
Hello, Does anyone here know for sure, when you do a For Each loop on a forms controls collection, does Access cycle through them in Alphabetical order or control ID or ???. Any ideas? ...
26
by: GreatAlterEgo | last post by:
Hi, This is my query which is embedded in a COBOL program. EXEC SQL SELECT DATE, AGE, DURATION, AMT INTO :LDATE, :L.AGE, :L.DURATION, :L.AMT FROM TAB1 WHERE CODE = :KEY.CODE AND...
104
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through...
7
by: mandible | last post by:
Hello I'm trying to have some control on how my data is ordered depending on an input parameter my question is in a stored procedure how can I do something like this at the end of my...
4
by: Yobbo | last post by:
Hi All My query is as follows: SELECT STRINGTEXT, TOKENID FROM WEBSTRINGS WHERE TOKENID IN (6,20,234,19,32,4,800,177) All I want is my resultset to come back in the order that I have...
1
by: 28490 | last post by:
Hi, In 10.2 when a query is run with GROUP BY it does not order the output by the grouped columns. In earlier versions the output was always sorted by the the grouped columns even though there...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.