Is it possible to access an SQL Server 2008 table with a column of type Geography using a Type Provider in F#?
This is my connection:
type dbSchemaAnalyticsWeb = SqlDataConnection<"Data Source=sql2008;Initial Catalog=Analytics;User ID=USER;Password=PASSWORD;">
Then the code to insert data:
let dbAnalyticsSQL = dbSchemaAnalyticsWeb.GetDataContext()
let sqlGeogBuild = new SqlGeographyBuilder()
sqlGeogBuild.BeginGeography(OpenGisGeographyType.Point);
sqlGeogBuild.BeginFigure(lat, long)
sqlGeogBuild.EndFigure()
sqlGeogBuild.EndGeography()
let LData = new dbSchemaAnalyticsWeb.ServiceTypes.LocationsData(
Address = address,
ZipCode = zipCode,
Longitude = long,
Latitude = lat,
GeoLocation = sqlGeogBuild.ConstructedGeography)
In the code above, the field GeoLocation references the Geography data type from SQL Server. However I get an error "The member or object constructor 'LocationData' has no argument or settable return property 'GeoLocation'. Is there another way to reference this field, or some other interface, or is this data type simply not accessible?
Note, I am using Visual Studio 2012 and .Net 4.5.