473,396 Members | 1,827 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,396 software developers and data experts.

Need help in visual studio 2005 to compare string

3
I'm developing a system which I want to locate different places. Have the database which contain some Latitude and longitude and want to compare with the one received from the GPS through GSM modem which are string. Example Latitude 3.23909S, Longitude 36.47961E. Assume I have in the database Latitude 3.24907S, Longitude 37.57899E as Location X and Latitude 2.98765S, Longitude 35.46769E as location Y. How can I compare and say that the string received from the GPS through GSM modem is greater than location Y or less than location X that in the database?
current I'm using
execproc.Parameters["@SearchValue1"].Value = Latitude.ToString();
execproc.Parameters["@SearchValue2"].Value = longitude.ToString();
drac = execproc.ExecuteReader();
if (drac.HasRows)
but this is only when they are equal.
Jul 5 '13 #1
6 1348
Rabbit
12,516 Expert Mod 8TB
Define 'less than'. It sounds like you mean where both long and lat is less than the long and lat of the input. And it sounds like 'more than' would be the opposite of that. But then you're missing other possibilities. What if the long is less but the lat is greater? What do you do then? Or what about the opposite of that? And what if one or more are equal? With your current definition of less and more, you have excluded multiple other possibilities.

If you want to return the other points so you can do a comparison, then don't restrict your query.
Jul 5 '13 #2
Kilavo
3
Thanks, Yes I agree with you that I'm missing some other possibilities. It become more complex, the other possibilities is when either long is less or greater and lat is equal and opposite.
Jul 5 '13 #3
Rabbit
12,516 Expert Mod 8TB
I'm not sure if you expected a response to that but just so you are aware, you haven't added anything to which I can respond. You've only reiterated my points.

If you're looking for additional help, then you need to respond to my points, not mirror them. Specifically, you need to now tell us how you want to handle those other situations and also you need to respond to my point regarding the restriction of the query.
Jul 5 '13 #4
Kilavo
3
The main thing I want to know is how to check/compare if the lat and long received from the GPS through GSM modem are located before, after or at point X or Y.
Jul 5 '13 #5
Rabbit
12,516 Expert Mod 8TB
You've already said that. And like I said before, you need to define before and after.
Jul 5 '13 #6
Frinavale
9,735 Expert Mod 8TB
It sounds like you probably want to get the last character off of the strings.

This will tell you if the lat. or long. is North, South, East or West.

The first thing I would do is check these values. If one is north and one is south, obviously the south one is "under" (less than?) the north one. Likewise if one is east and one is west, obviously they don't equal.

You need to determine, using your own business rules, which is "greater".
For example, is:
  • North>South?
  • North<South?
  • West>East?
  • West<East?

If the characters match (meaning they are both marking North, South, East or West) then you need to compare the numbers.

I would use the one of the Double.TryParse Methods. That will give you back a number and you can just compare whether or not it's larger.

-Frinny
Jul 9 '13 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Shapper | last post by:
Hello, I am starting 2 new projects to deliver in January 2006. I want to create them in Asp.Net 2.0 using Visual Studio 2005. All my clients web sites are Visual Studio 2003 projects in...
7
by: Victor S. | last post by:
1. What is System.Windows.Forms.VisualStyles.TextMetricsCharacterSet good for? 2. Are the Indic scripts supported? Are all supported scripts fully supported? (for printing and fine measuring)...
6
by: Tom McL. | last post by:
I'm trying to move a program that was designed using Visual Studio 2003 and (Visual Basic) into Visual Studio 2005. When it runs I get the following warning in the Error List Window and I'm not...
13
by: sck10 | last post by:
Hello, I am trying to find the option VS2K5 that will automatically change HtmlMeta hm=new HtmlMeta(); or HtmlMeta hm = new HtmlMeta(); to HtmlMeta hm = new HtmlMeta(); What I would...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
1
by: MPA | last post by:
Hi, I am a newbee and wanted to ask you a question concearning Visual Web Developer. It was described as "light weighted", but having positively experimented with it I don't understand what am I...
6
by: Mister Scary | last post by:
What are the capabilities of Visual Studio 2005 Standard vs. Visual Studio 2005 Professional? I am principally a C++ guy but I do have some interest in learning C#.
3
by: Edwin Smith | last post by:
I have a 2 form project in VS2005 that now hangs whenever I try to do anything with the second form. This seems to have started when I added some SQL tables from a Pervasive v.9 database using the...
1
by: DR | last post by:
What ports do i need to unblock on client and server (running msvsmon.exe) to debug remotely from my client box with visual studio 2005 pro? When I attach to remote process a connection shows up...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I must be out of my mind. I used visual studio .net 2003 before and I installed 2005 a while back, but seldom to use it. Recently I was required to start to learn C# asp.net. So I tried...
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.