Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > help with string compare

Reply
Thread Tools

help with string compare

 
 
jrthor2
Guest
Posts: n/a
 
      04-16-2004
I have a .net application that is using microsofts locator service. I
have this working, but when I select a user to locate from my contact
list, it comes back with a map, but the pushpin has the users
domain\username as the pin label. I would lik to show the person's
display name instead. I was told I need to iterate through my array
of locatable contacts, performing a string compare of pr.DomainAlias
to LocatableContact.DomainAlias. When I find the match, you'd
then have to get the display name from there, and assign it to
p.Label. Below is my code when selecting a contact from my list,
could someone help me do this. I am very new to .NET. Thanks


If rbBuddy.Checked = True Then

Dim myContacts() As LocatableContact
myContacts = Session("myContacts")

Dim li As ListItem
Dim al As ArrayList = New ArrayList

Dim cnt As Integer = -1

For Each li In lstBuddies.Items
cnt = cnt + 1
If li.Selected = True Then

al.Add(mycontacts(cnt).DomainAlias)
End If
Next

Dim users(al.Count - 1) As String
users = al.ToArray(GetType(String))

Try
posResults = locService.GetPositions(users)

If posResults.PositionsFound <= 0 Then
lblMessage.Text = "Problem finding."
Else
Dim pr As Position
Dim local As New ArrayList
Dim l As Location = New Location


For Each pr In posResults.Positions
If pr.ResultCode =
PositionResultCode.Succeeded Then
Dim p As New Pushpin
p.Label = pr.DomainAlias
p.LatLong = pr.LatLong
'p.IconDataSource =
"MapPoint.Icons"
'p.IconName = "152"
'prgjr1 - use our custom icons
p.IconDataSource =
"Rite_Aid.8792"
p.IconName = "mobile_phone"
p.PinID = "pinid"
pins.Add(p)
l = New Location
l.LatLong = New LatLong
l.LatLong = pr.LatLong

local.Add(l)
End If
Next

lblMessage.Text = "Found Location!"

Dim myRenderService As New RenderServiceSoap
myRenderService =
Session("myRenderService")

Dim ds As String
ds = lstDatasource.SelectedValue
mv = myRenderService.GetBestMapView( _

local.ToArray(GetType(Location)),
ds).ByHeightWidth

'mv.CenterPoint =
posResults.Positions(0).LatLong
'mv.Height = 1.0
'mv.Width = 1.0
'lstZoom.SelectedIndex = 2

End If
Catch ex As Exception
lblMessage.Text = "Error Finding Buddies. Try
again in a few minutes." '& ex.ToString

End Try
End If

[/code]

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
searching an array, string compare functions, string sorting ckirchho@directmedia.de Javascript 2 10-10-2007 11:23 PM
compare string and "" string literal lovecreatesbea...@gmail.com C++ 10 01-24-2007 09:55 PM
strcmp vs. string::compare(const string &) lchian@yahoo.com C++ 10 03-03-2006 08:53 PM
Help in STRING compare ? tvn007@hotmail.com C++ 3 11-07-2005 08:20 PM
Urgent help needed! Compare a string to Sysdate in Oracle WroteForLuck ASP General 1 07-17-2003 03:23 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57