473,503 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with string compare

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]

Nov 18 '05 #1
0 1154

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

Similar topics

13
6188
by: webzila | last post by:
Hello, I have to write a program for an 8051 micro-controller using micro-C to monitor Switch 1 and if the switch in pushed the message "switch 1 pushed" should be displayed in the LCD. Also the...
8
3238
by: Jack Addington | last post by:
I want to scroll through the alphabet in order to scroll some data to the closest name that starts with a letter. If the user hits the H button then it should scroll to the letter closest to H. ...
7
2641
by: Drew Berkemeyer | last post by:
I've encounted a pretty strange problem and I'm not quite sure what to make of it. I have a web service that consumes an XML file as well as a few other parameters. This web service works fine...
3
1205
by: Craig | last post by:
Hi I'm having some troubles getting my regex to work. I have a string as follows The "quick and brown" fox "jumped over the" lazy dog. The output should be as follows: The "quick and brown"...
5
3766
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one please help me with this? static public...
6
1864
by: Burt | last post by:
I need to create a collection of classes (or structures) can be accessed by a string key, eg MyColl("ShortName5").Name for class with key ShortName5. But it also has to be sorted by a second...
4
1621
nomad
by: nomad | last post by:
I'm very new to java and programing. I need some help with this. Check each user entry to ensure validity. Color is either Black, White, or Red. if the user enter the wrong color the following with...
7
1069
by: cirfu | last post by:
pat = re.compile("(\w* *)*") this matches all sentences. if fed the string "are you crazy? i am" it will return "are you crazy". i want to find a in a big string a sentence containing Zlatan...
0
1450
by: =?Utf-8?B?Sm9obkJhdGVz?= | last post by:
This is my first custom installer and essentially I needed to create one that installed windows installer 3.1 then installed .Net 2.0 Service Pack 1. I could not find a pre-packaged .Net 2.o SP 1...
11
4338
by: blunt | last post by:
trying to write a program to write the configuration files for a load of wireless access points. i've never been a good programmer and haven't done any for nearly a decade so have obviously made some...
0
7192
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
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7261
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
7315
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
6974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4991
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
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
721
muto222
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.