Re: Still Problem with Dataview.Find by jeff
jeff
Sat Nov 13 12:30:24 CST 2004
Um, so I assumed you considered that the position may be zero-based? Can't
you just subtract one from AnInteger??
Jeff
"Charles A. Lackman" <Charles@CreateItSoftware.net> wrote in message
news:#X3py0ayEHA.3588@TK2MSFTNGP14.phx.gbl...
> Hello,
>
> Question 1,
>
> Yes if there are three it goes to the second record (not the last one).
It
> is an Off-by-one error.
>
> Question 2,
>
> Yes I am determining the first based on the physical ordering in the
table.
> It does not really matter at this point what order they are in.
>
> Question 3,
>
> The First Name is not known. Therefore I cannot sort by both because the
> find method then requires an array with both the Last Name and First Name.
> If I make the First Name equal to Nothing or "" then -1 is returned as the
> index.
>
> Chuck
>
>
> <jeff@removeemergencyreporting.com> wrote in message
> news:%23JP4U9QyEHA.1300@TK2MSFTNGP14.phx.gbl...
> >I had asked 3 questions
> >
> > "Charles A. Lackman" <Charles@CreateItSoftware.net> wrote in message
> > news:uhp3KwQyEHA.1260@TK2MSFTNGP12.phx.gbl...
> >> Hello,
> >>
> >> When I sort by LastName and FirstName I have to send an array to the
Find
> >> Method,
> >> If I do not know what the First Name is it does not return anything.
> >>
> >> Any suggestions??
> >> Chuck
> >>
> >> <jeff@removeemergencyreporting.com> wrote in message
> >> news:%23R0NqxPyEHA.3976@TK2MSFTNGP09.phx.gbl...
> >> > It there is three, does it still go to the last one? Just checking
for
> >> > "off-by-one" errors.
> >> >
> >> > Also, there is no concept of "first" or "last" in set logic when you
> >> > return
> >> > multiple. How are YOU determining first? Physical ordering in the
> >> > table?
> >> > Bad....
> >> >
> >> > Perhaps try adding order by lastname, firstname?
> >> >
> >> > Jeff
> >> >
> >> > "Charles A. Lackman" <Charles@CreateItSoftware.net> wrote in message
> >> > news:u0hp6oNyEHA.2568@TK2MSFTNGP11.phx.gbl...
> >> >> Hello,
> >> >>
> >> >> When I Do Desc, It works but everything is backwards. All the
records
> > go
> >> >> from Z - A. I need them to go from A - Z and grab the first one it
> >> >> finds.
> >> >>
> >> >> ASC reproduces the behaviour stated below:
> >> >>
> >> >> I am retrieving data from a database "Order By LastName", when I
use
> >> >> a
> >> >> dataview to find a Last Name it does not give me the first instance
> >> >> of
> >> > the
> >> >> Last Name.
> >> >>
> >> >> ie.
> >> >>
> >> >> ADataView.Sort = "LastName"
> >> >> AnInteger=ADataView.find("Smith")
> >> >> BindingContext(ADataView).Position = AnInteger
> >> >>
> >> >> If there are more than one "Smith" in the database it goes to the
> > second
> >> >> one instead of the First one.
> >> >>
> >> >> What I need is for it to go to the first one.
> >> >>
> >> >> Any suggestions will be greatly appreciated.
> >> >>
> >> >>
> >> >> Thanks,
> >> >> Chuck
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>