Skip to content

Instantly share code, notes, and snippets.

View davecan's full-sized avatar

David Cantrell davecan

View GitHub Profile
@tugberkugurlu
tugberkugurlu / DbGeographyTryOut.cs
Created June 4, 2012 19:51
System.Data.Spatial.DbGeography sample (Latitude and Longitude).
class Program {
public class Db {
public static Dictionary<string, DbGeography> Locations = new Dictionary<string, DbGeography>() {
//instert the place locations here...
};
}
@x-a-n-d-e-r-k
x-a-n-d-e-r-k / DbDataReaderExtensions.cs
Created May 1, 2012 02:10
DbDataReader Extensions - Very Handy
using System;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
public static class DbReaderExtensions {
public static string SafeGetString(this DbDataReader reader, string columnName) {
var index = reader.GetOrdinal(columnName);
return !reader.IsDBNull(index) ? reader.GetString(index) : string.Empty;