Welcome :Guest
Congratulations!!!

### Calculate distance, bearing and more between Latitude/Longitude points

This page presents a variety of calculations for latitude/longitude points, with the formulÃÂ¦ and code fragments for implementing them.

All these formulÃÂ¦ are for calculations on the basis of a spherical earth (ignoring ellipsoidal effects) - which is accurate enough* for most purposes. [In fact, the earth is very slightly ellipsoidal; using a spherical model gives errors typically up to 0.3% - see notes for further details].

### Calculate GPS Distance with SQL?

CREATE TABLE [dbo].[Logs](

[logDate] [datetime] NOT NULL,
[logType] [int] NOT NULL,
[logCacher] [varchar](128) NOT NULL,
[cacheId] [int) NOT NULL,
) ON [PRIMARY]

CREATE TABLE [dbo].[Caches](

[cacheId] [int] NOT NULL,
[cacheName] [varchar](128) NOT NULL,
[latitude] [float] NOT NULL,
[longitude] [float] NOT NULL,
) ON [PRIMARY]

Some sample data:

INSERT INTO Caches VALUES ( 1, 'cache1', 38.1, -9.1 )
INSERT INTO Caches VALUES ( 2, 'cache2', 38.2, -9.2 )
INSERT INTO Caches VALUES ( 3, 'cache3', 38.3, -9.3 )
INSERT INTO Caches VALUES ( 4, 'cache4', 38.4, -9.4 )
INSERT INTO Caches VALUES ( 5, 'cache5', 38.5, -9.5 )

INSERT INTO Logs VALUES ( '21/11/2007 00:00', 1, 'geocacher1', 1 )
INSERT INTO Logs VALUES ( '21/11/2007 10:00', 1, 'geocacher1', 2 )
INSERT INTO Logs VALUES ( '22/11/2007 00:00', 1, 'geocacher1', 3 )
INSERT INTO Logs VALUES ( '22/11/2007 10:00', 1, 'geocacher1', 4 )
INSERT INTO Logs VALUES ( '23/11/2007 00:00', 1, 'geocacher1', 5 )

INSERT INTO Logs VALUES ( '23/11/2007 00:00', 1, 'geocacher2', 1 )
INSERT INT

### Logic to calculate business hours

Hi All,

I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.

I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.

### Data Points: Deny Table Access to the Entity Framework Without Causing a Mutiny

Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.

Julie Lerman

MSDN Magazine August 2010

### Data Points: Windows Azure Table Storage - Not Your Father's Database

Let go of your traditional relational database thinking if you want to understand how Windows Azure Table storage works, says Julie Lerman. Luckily for you, she's done the hard work to grasp the new concepts and help you get up to speed.

Julie Lerman

MSDN Magazine July 2010

### Data Points: LINQ Projection Queries and Alternatives in WCF Services

LINQ's ability to project randomly shaped data into anonymous types can be a blessing and a source of frustration, says Julie Lerman. It's great when you just need to grab a special view of your data, but it can be problematic in certain circumstances. She explains what the limitations are and how to get around them.

Julie Lerman

MSDN Magazine May 2010

### Data Points: Precompiling LINQ Queries

Did you know that by precompiling LINQ queries you might actually be degrading your app's performance if you're not careful? Julie Lerman explains how to ensure you're not re-precompiling queries each time and losing the expected performance benefits across post-backs, short-lived service operations and other code where critical instances are going out of scope.

Julie Lerman

MSDN Magazine March 2010

### Data Points: Data Validation with Silverlight 3 and the DataForm

In this month's column, John Papa shows you how the DataForm control works and how it can be customized.ÃÂ  He presents in detail a sample application that uses several features to bind, navigate, edit and validate data using the DataForm.

John Papa

MSDN Magazine October 2009

### Data Points: Data Performance and Fault Strategies in Silverlight 3

In this month's column, the author shows how binary encoding works, the effect it has on an application's performance, and how it behaves by demonstrating it in action.

John Papa

MSDN Magazine August 2009

### Data Points: Building An Out-of-Browser Client With Silverlight 3

Silverlight 2 applications are restricted to running inside a browser. However, Silverlight 3 applications can run inside the browser or out. Here we build a social networking app as a standalone Silverlight 3 application.

John Papa

MSDN Magazine June 2009

### Data Points: Using Silverlight 2 With ADO.NET Data Services

ADO.NET Data Services and Silverlight make a powerful combination, but to make them work well together, there are a few things you need to understand. Here, John Papa explains.

John Papa

MSDN Magazine April 2009

### Data Points: Syndicated Data And Isolated Storage In Silverlight

Here we build a syndicated news reader application to illustrate the use of isolated storage and data syndication in Silverlight.

John Papa

MSDN Magazine February 2009

### Data Points: Cloud Gazing From Silverlight 2

John Papa tackles questions about calling services from Silverlight 2 applications.

John Papa

MSDN Magazine November 2008

### Data Points: Service-Driven Apps With Silverlight 2 And WCF

Here John Papa demonstrates how to build a Silverlight 2 user interface that communicates through WCF to interact with business entities and a database.

John Papa

MSDN Magazine September 2008

### Data Points: The Entity Framework in Layered Architectures

Here we build a solution that fits the Entity Framework into an n-tier architecture that uses WCF and WPF and the MVP pattern.

John Papa

MSDN Magazine July 2008

### Data Points: Entity Framework Q&A

The Entity Framework is a hot topic, but how do you know when to use EntityClient, Object Services, Entity SQL, or LINQ? Find out here.

John Papa

MSDN Magazine May 2008

### Data Points: Standard Query Operators with LINQ

LINQ to Objects and LINQ to Entities have an arsenal of Standard Query Operators that operate on sequences to perform a wide variety of operations.

John Papa

MSDN Magazine March 2008

 Categories:
 ASP.Net Windows Application .NET Framework C# VB.Net ADO.Net Sql Server SharePoint Silverlight Others All