473,378 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 744

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

Similar topics

13
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
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.