On 29 май, 18:05, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no
instrument no spam DOT com> wrote:
> Maybe I'm thinking about this the wrong way, but what do you mean by "row
> number"? The table itself doesn't have row numbers, generally. Rows are
[quoted text clipped - 10 lines]
>
> > Thanks for help!
I have the query with ORDER clause and I what to see the row number in
that query.
Something like this:
SELECT ROWNUM(), COL1, COL2 FROM TABLE1 ORDER BY COL1
Ginny Caughey MVP - 29 May 2008 16:37 GMT
As Paul says, SQL Compact doesn't have row numbers. Why do you think you
need that? For example, if you need to update changes you make to the data
selected and you want to find that row again, you'll use a primary key value
to know which row in the database to update.
Ginny Caughey
Device Application Development MVP
On 29 май, 18:05, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no
instrument no spam DOT com> wrote:
> Maybe I'm thinking about this the wrong way, but what do you mean by "row
> number"? The table itself doesn't have row numbers, generally. Rows are
[quoted text clipped - 16 lines]
>
> > Thanks for help!
I have the query with ORDER clause and I what to see the row number in
that query.
Something like this:
SELECT ROWNUM(), COL1, COL2 FROM TABLE1 ORDER BY COL1
MrZoidberg - 29 May 2008 16:51 GMT
On 29 май, 18:37, "Ginny Caughey MVP"
<ginny.caughey.onl...@wasteworks.com> wrote:
> As Paul says, SQL Compact doesn't have row numbers. Why do you think you
> need that? For example, if you need to update changes you make to the data
[quoted text clipped - 32 lines]
> Something like this:
> SELECT ROWNUM(), COL1, COL2 FROM TABLE1 ORDER BY COL1
Thanks for the answer.
I have the following problem. Some service insert the new row to the
table. Then i have the virtual ListView control where that table data
is shown. It has sorting (non-standard) and can have filtering. I need
to know the row number of the inserted row in the ListView. I know the
inserted row primary key and that the row number will be equal to the
row number in the query. I really don't want to get all the table data
and count rows by-hand.
P.S. Sorry for my English =)
Ginny Caughey MVP - 29 May 2008 17:56 GMT
How about ListView.Items.IndexOf() ? You can get the count of the number of
rows in the listview with ListView.Items.Count.
Ginny
On 29 май, 18:37, "Ginny Caughey MVP"
<ginny.caughey.onl...@wasteworks.com> wrote:
> As Paul says, SQL Compact doesn't have row numbers. Why do you think you
> need that? For example, if you need to update changes you make to the data
[quoted text clipped - 38 lines]
> Something like this:
> SELECT ROWNUM(), COL1, COL2 FROM TABLE1 ORDER BY COL1
Thanks for the answer.
I have the following problem. Some service insert the new row to the
table. Then i have the virtual ListView control where that table data
is shown. It has sorting (non-standard) and can have filtering. I need
to know the row number of the inserted row in the ListView. I know the
inserted row primary key and that the row number will be equal to the
row number in the query. I really don't want to get all the table data
and count rows by-hand.
P.S. Sorry for my English =)
MrZoidberg - 29 May 2008 18:45 GMT
On 29 май, 19:56, "Ginny Caughey MVP"
<ginny.caughey.onl...@wasteworks.com> wrote:
> How about ListView.Items.IndexOf() ? You can get the count of the number of
> rows in the listview with ListView.Items.Count.
[quoted text clipped - 58 lines]
>
> P.S. Sorry for my English =)
Thak's all!
It's good idea but my ListView can have up to 100.000 items and
ListView.Items.IndexOf() will be retrieving all the data until the row
is found. I think the performance will be very slow. Thank you guys, I
realized I need to re-think my architecture.
Ginny Caughey MVP - 29 May 2008 18:52 GMT
I agree, I think rearchitecting might be a good idea. You need something
that is indexed to be able to quickly find newly added items of data, and
the database has that capability already, so perhaps the service should add
new items there instead of to a list view.
Ginny
On 29 май, 19:56, "Ginny Caughey MVP"
<ginny.caughey.onl...@wasteworks.com> wrote:
> How about ListView.Items.IndexOf() ? You can get the count of the number
> of
[quoted text clipped - 65 lines]
>
> P.S. Sorry for my English =)
Thak's all!
It's good idea but my ListView can have up to 100.000 items and
ListView.Items.IndexOf() will be retrieving all the data until the row
is found. I think the performance will be very slow. Thank you guys, I
realized I need to re-think my architecture.
Paul G. Tobey [eMVP] - 29 May 2008 17:15 GMT
I don't see any documented way of doing that in SQL Compact 3.5. I suppose
that what you do next to try to fake this probably depends on how you're
using the data that comes back from your query...
Paul T.
On 29 ÍÁÊ, 18:05, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no
instrument no spam DOT com> wrote:
> Maybe I'm thinking about this the wrong way, but what do you mean by "row
> number"? The table itself doesn't have row numbers, generally. Rows are
[quoted text clipped - 16 lines]
>
> > Thanks for help!
I have the query with ORDER clause and I what to see the row number in
that query.
Something like this:
SELECT ROWNUM(), COL1, COL2 FROM TABLE1 ORDER BY COL1