Ask a Question related to ASP.NET General, Design and Development.
-
Pete Wright #1
Re: Code optimization...
This is a trick question right? I mean, you know that there is only one
element in the rsc.SelectedIndexes, so how would you optimize the loop.
Ok, well, on the off-chance that it's not a trick question (and, BTW, Index
= selectedIndex.ToString will never work, since Index is an integer and
ToString() returns a string, but anyway....
Dim Index as Integer
Index = Int32.Parse(rsc.SelectedIndexes(1))
There yah go - I am of course assuming that the index of the one item in the
array is item number 1.
--
Peter Wright
Author of ADO.NET Novice To Pro, from Apress Inc.
"Raphaël Désalbres" <raphael@desalbres.com> wrote in message
news:ePf8jywQDHA.3880@tk2msftngp13.phx.gbl...one> Hello,
>
> I would like to optimize the following code, knowing that there is only> element in SelectedIndexes.
>
> Dim selectedIndex, Index As Integer
> For Each selectedIndex In rsc.SelectedIndexes
> Index = selectedIndex.ToString
> Next
>
> Thanks,
>
> Raphaël Désalbres
>
>
>
Pete Wright Guest
-
pdf optimization
how to optimize pdf doc in c# -
FMS - video optimization
Hello, I'm currently writing an application which going to broadcast LIVE video from about 30-40 broadcaster. The application is going to use... -
3D optimization
HI All, I've made a 3D environment in lingo with Director MX, which uses some Havok physics - not much at the moment as I was concentrating on... -
Index optimization ?
Hi ... In my quest to get rid of the oid dependency, i have made some new low level code with the help from many nice people from this community... -
Looking for Optimization
hiya I'd like to optimize a code snippet I wrote: ------------------------------------------------------------------------ while ($Girl =... -
Raphaël Désalbres #2
Re: Code optimization...
Thanks very much for your reply, Peter...
Sincerely,
Raphaël Désalbres
"Pete Wright" <pete@codemonkey.demon.co.uk> escreveu na mensagem
news:be70io$8t1$1$8300dec7@news.demon.co.uk...Index> This is a trick question right? I mean, you know that there is only one
> element in the rsc.SelectedIndexes, so how would you optimize the loop.
>
> Ok, well, on the off-chance that it's not a trick question (and, BTW,the> = selectedIndex.ToString will never work, since Index is an integer and
> ToString() returns a string, but anyway....
>
> Dim Index as Integer
> Index = Int32.Parse(rsc.SelectedIndexes(1))
>
> There yah go - I am of course assuming that the index of the one item in> array is item number 1.
> --
> Peter Wright
> Author of ADO.NET Novice To Pro, from Apress Inc.
>
>
> "Raphaël Désalbres" <raphael@desalbres.com> wrote in message
> news:ePf8jywQDHA.3880@tk2msftngp13.phx.gbl...> one> > Hello,
> >
> > I would like to optimize the following code, knowing that there is only>> > element in SelectedIndexes.
> >
> > Dim selectedIndex, Index As Integer
> > For Each selectedIndex In rsc.SelectedIndexes
> > Index = selectedIndex.ToString
> > Next
> >
> > Thanks,
> >
> > Raphaël Désalbres
> >
> >
> >
>
Raphaël Désalbres Guest
-
David Waz... #3
Re: Code optimization...
but, only two problems here
first, that's why there's a .ToString method - to convert the integer to
string, so that will work.
and secondly, the index, i believe, is ZERO based:
rcs.SelectedIndexes(0)
and finally, what ASPX control has a SelectedIndexes collection in the first
place? I don't recall any.
There are 3rd party controls that use this, but ASPX???
Pete, I think this WAS a trick question! :-)
"Pete Wright" <pete@codemonkey.demon.co.uk> wrote in message
news:be70io$8t1$1$8300dec7@news.demon.co.uk...Index> This is a trick question right? I mean, you know that there is only one
> element in the rsc.SelectedIndexes, so how would you optimize the loop.
>
> Ok, well, on the off-chance that it's not a trick question (and, BTW,the> = selectedIndex.ToString will never work, since Index is an integer and
> ToString() returns a string, but anyway....
>
> Dim Index as Integer
> Index = Int32.Parse(rsc.SelectedIndexes(1))
>
> There yah go - I am of course assuming that the index of the one item in> array is item number 1.
> --
> Peter Wright
> Author of ADO.NET Novice To Pro, from Apress Inc.
>
>
> "Raphaël Désalbres" <raphael@desalbres.com> wrote in message
> news:ePf8jywQDHA.3880@tk2msftngp13.phx.gbl...> one> > Hello,
> >
> > I would like to optimize the following code, knowing that there is only>> > element in SelectedIndexes.
> >
> > Dim selectedIndex, Index As Integer
> > For Each selectedIndex In rsc.SelectedIndexes
> > Index = selectedIndex.ToString
> > Next
> >
> > Thanks,
> >
> > Raphaël Désalbres
> >
> >
> >
>
David Waz... Guest



Reply With Quote

