# Using sql view as basis for MsSQLFeatureLayer?

**URL:** <https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658>\
**Category:** WinForms\
**Created:** [September 3, 2009, 6:52pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658 "2009-09-03T18:52:07Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kimberly](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kimberly](https://community.thinkgeo.com/u/Kimberly)\
**Post date:** [September 3, 2009, 6:52pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/1 "2009-09-03T18:52:07Z")

</div>

Hello&nbsp;everyone,

I&nbsp;found&nbsp;a&nbsp;post&nbsp;about&nbsp;this,&nbsp;but&nbsp;the&nbsp;one&nbsp;that&nbsp;seemed&nbsp;most&nbsp;detailed&nbsp;is&nbsp;dated&nbsp;4/20.&nbsp;I'm&nbsp;wondering&nbsp;if&nbsp;there&nbsp;is&nbsp;an&nbsp;update&nbsp;to&nbsp;that&nbsp;story.

I'd&nbsp;like&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;have&nbsp;a&nbsp;feature&nbsp;layer&nbsp;based&nbsp;on&nbsp;a&nbsp;sql&nbsp;view.&nbsp;I&nbsp;created&nbsp;the&nbsp;view&nbsp;and&nbsp;tried&nbsp;referencing&nbsp;its&nbsp;name&nbsp;in&nbsp;place&nbsp;of&nbsp;the&nbsp;table&nbsp;name,&nbsp;but&nbsp;it&nbsp;came&nbsp;up&nbsp;with&nbsp;an&nbsp;error&nbsp;about&nbsp;not&nbsp;being&nbsp;able&nbsp;to&nbsp;find&nbsp;the&nbsp;geometry&nbsp;column.&nbsp;Incidentally,&nbsp;that's&nbsp;the&nbsp;same&nbsp;error&nbsp;you&nbsp;get&nbsp;if&nbsp;you&nbsp;don't&nbsp;have&nbsp;permissions&nbsp;to&nbsp;the&nbsp;table&nbsp;and&nbsp;if&nbsp;the&nbsp;table&nbsp;doesn't&nbsp;exist.&nbsp;In&nbsp;any&nbsp;case,&nbsp;I&nbsp;verifed&nbsp;that&nbsp;the&nbsp;name&nbsp;in&nbsp;the&nbsp;code&nbsp;matches&nbsp;the&nbsp;name&nbsp;on&nbsp;the&nbsp;server&nbsp;and&nbsp;that&nbsp;doesn't&nbsp;seem&nbsp;to&nbsp;be&nbsp;correct.

Has&nbsp;this&nbsp;functionality&nbsp;been&nbsp;implemented&nbsp;since&nbsp;the&nbsp;thread&nbsp;on&nbsp;4/20?&nbsp;If&nbsp;so,&nbsp;is&nbsp;there&nbsp;something&nbsp;different&nbsp;I&nbsp;need&nbsp;to&nbsp;do&nbsp;to&nbsp;make&nbsp;this&nbsp;work?

Thank&nbsp;you,

Kimberly

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [September 4, 2009, 12:56am UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/2 "2009-09-04T00:56:43Z")

</div>

Kimberly,

We&nbsp;have&nbsp;discussed&nbsp;this&nbsp;problem&nbsp;recently&nbsp;in&nbsp;several&nbsp;posts&nbsp;as&nbsp;following,&nbsp;please&nbsp;take&nbsp;a&nbsp;look&nbsp;if&nbsp;you&nbsp;are&nbsp;interested.

[gis.thinkgeo.com/Support/Dis...fault.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6131/afv/topic/Default.aspx)  
  
[gis.thinkgeo.com/Support/Dis...fault.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6131/afv/topic/Default.aspx)

Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.

Thanks.

Yale  
  
&nbsp;

---

<div class="post-metadata">

**Author:** ![Kimberly](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kimberly](https://community.thinkgeo.com/u/Kimberly)\
**Post date:** [September 4, 2009, 10:52am UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/3 "2009-09-04T10:52:04Z")

</div>

Both&nbsp;of&nbsp;the&nbsp;links&nbsp;you&nbsp;posted&nbsp;above&nbsp;are&nbsp;the&nbsp;same.&nbsp;I&nbsp;didn't&nbsp;find&nbsp;anything&nbsp;newer&nbsp;in&nbsp;my&nbsp;searching,&nbsp;I'm&nbsp;sure&nbsp;I&nbsp;just&nbsp;didn't&nbsp;have&nbsp;the&nbsp;keywords&nbsp;right&nbsp;to&nbsp;find&nbsp;those&nbsp;specifically.&nbsp;  
  
  
  
So&nbsp;are&nbsp;you&nbsp;saying&nbsp;that&nbsp;I&nbsp;can't&nbsp;reference&nbsp;a&nbsp;view&nbsp;directly?&nbsp;I&nbsp;have&nbsp;a&nbsp;view&nbsp;on&nbsp;the&nbsp;server&nbsp;saved.&nbsp;I&nbsp;don't&nbsp;need&nbsp;to&nbsp;be&nbsp;writing&nbsp;the&nbsp;query&nbsp;into&nbsp;my&nbsp;code&nbsp;as&nbsp;it's&nbsp;already&nbsp;defined.&nbsp;I&nbsp;don't&nbsp;want&nbsp;to&nbsp;write&nbsp;the&nbsp;query&nbsp;into&nbsp;my&nbsp;code&nbsp;because&nbsp;unless&nbsp;there&nbsp;is&nbsp;a&nbsp;very&nbsp;solid&nbsp;reason,&nbsp;I&nbsp;think&nbsp;that&nbsp;writing&nbsp;SQL&nbsp;code&nbsp;in&nbsp;my&nbsp;C#&nbsp;code&nbsp;is&nbsp;bad&nbsp;programming&nbsp;practice.&nbsp;(Charles&nbsp;example&nbsp;is&nbsp;probably&nbsp;a&nbsp;good&nbsp;example,&nbsp;I&nbsp;won't&nbsp;have&nbsp;that&nbsp;issue&nbsp;at&nbsp;all,&nbsp;I&nbsp;need&nbsp;about&nbsp;15&nbsp;views&nbsp;total&nbsp;I&nbsp;think.)  
  
  
  
Can&nbsp;I&nbsp;use&nbsp;a&nbsp;view&nbsp;that&nbsp;is&nbsp;already&nbsp;defined&nbsp;on&nbsp;the&nbsp;server&nbsp;without&nbsp;having&nbsp;to&nbsp;catch&nbsp;the&nbsp;event&nbsp;and&nbsp;write&nbsp;my&nbsp;own&nbsp;SQL?&nbsp;  
  
  
  
Thank&nbsp;you.&nbsp;  
  
Kimberly

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 6, 2009, 7:48pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/4 "2009-09-06T19:48:19Z")

</div>

Kimberly,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;As&nbsp;far&nbsp;as&nbsp;I&nbsp;know&nbsp;you&nbsp;can&nbsp;access&nbsp;a&nbsp;view&nbsp;just&nbsp;as&nbsp;you&nbsp;would&nbsp;a&nbsp;normal&nbsp;table.&nbsp;&nbsp;There&nbsp;is&nbsp;nothing&nbsp;special&nbsp;you&nbsp;need&nbsp;to&nbsp;do.&nbsp;&nbsp;If&nbsp;I&nbsp;remember&nbsp;correctly&nbsp;we&nbsp;have&nbsp;a&nbsp;number&nbsp;of&nbsp;people&nbsp;doing&nbsp;this&nbsp;currently.&nbsp;&nbsp;(If&nbsp;you&nbsp;are&nbsp;a&nbsp;customer&nbsp;on&nbsp;the&nbsp;forum&nbsp;doing&nbsp;this&nbsp;give&nbsp;us&nbsp;a&nbsp;shout)&nbsp;&nbsp;The&nbsp;system&nbsp;can’t&nbsp;tell&nbsp;what&nbsp;is&nbsp;a&nbsp;table&nbsp;or&nbsp;what&nbsp;is&nbsp;a&nbsp;view,&nbsp;you&nbsp;just&nbsp;have&nbsp;to&nbsp;make&nbsp;sure&nbsp;the&nbsp;view&nbsp;returns&nbsp;the&nbsp;geometry&nbsp;column&nbsp;just&nbsp;like&nbsp;it&nbsp;was&nbsp;a&nbsp;spatial&nbsp;table.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;The&nbsp;technique&nbsp;with&nbsp;the&nbsp;events&nbsp;are&nbsp;for&nbsp;people&nbsp;who&nbsp;want&nbsp;to&nbsp;tweak&nbsp;things&nbsp;a&nbsp;step&nbsp;further.&nbsp;&nbsp;For&nbsp;example&nbsp;views&nbsp;are&nbsp;good&nbsp;in&nbsp;replacement&nbsp;for&nbsp;tables&nbsp;when&nbsp;you&nbsp;have&nbsp;some&nbsp;small&nbsp;number&nbsp;of&nbsp;pre-defined&nbsp;scenarios&nbsp;but&nbsp;some&nbsp;people&nbsp;want&nbsp;to&nbsp;dynamically&nbsp;change&nbsp;up&nbsp;filter&nbsp;criteria.&nbsp;&nbsp;Their&nbsp;only&nbsp;option&nbsp;before&nbsp;we&nbsp;put&nbsp;in&nbsp;the&nbsp;support&nbsp;for&nbsp;the&nbsp;events&nbsp;was&nbsp;to&nbsp;create&nbsp;a&nbsp;bunch&nbsp;of&nbsp;views&nbsp;for&nbsp;every&nbsp;scenario.&nbsp;&nbsp;Based&nbsp;on&nbsp;feedback&nbsp;that&nbsp;some&nbsp;customers&nbsp;have&nbsp;literally&nbsp;thousands&nbsp;of&nbsp;potential&nbsp;combination&nbsp;we&nbsp;allowed&nbsp;them&nbsp;to&nbsp;have&nbsp;the&nbsp;finest&nbsp;grain&nbsp;control&nbsp;over&nbsp;the&nbsp;SQL&nbsp;itself.&nbsp;&nbsp;They&nbsp;can&nbsp;manipulate&nbsp;the&nbsp;SQL&nbsp;statement&nbsp;to&nbsp;add&nbsp;additional&nbsp;where&nbsp;clause&nbsp;items,&nbsp;joins,&nbsp;sub&nbsp;queries&nbsp;etc.&nbsp;&nbsp;This&nbsp;means&nbsp;they&nbsp;have&nbsp;allot&nbsp;of&nbsp;control&nbsp;but&nbsp;at&nbsp;the&nbsp;cost&nbsp;of&nbsp;having&nbsp;to&nbsp;know&nbsp;exactly&nbsp;what&nbsp;they&nbsp;are&nbsp;doing&nbsp;and&nbsp;having&nbsp;to&nbsp;write&nbsp;some&nbsp;extra&nbsp;code.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David&nbsp;

---

<div class="post-metadata">

**Author:** ![Kimberly](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kimberly](https://community.thinkgeo.com/u/Kimberly)\
**Post date:** [September 14, 2009, 2:38pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/5 "2009-09-14T14:38:20Z")

</div>

David,&nbsp;thanks&nbsp;for&nbsp;the&nbsp;response.&nbsp;I&nbsp;have&nbsp;gone&nbsp;back&nbsp;over&nbsp;everything&nbsp;I&nbsp;could&nbsp;think&nbsp;of&nbsp;to&nbsp;check.&nbsp;The&nbsp;error&nbsp;I'm&nbsp;getting&nbsp;is&nbsp;still&nbsp;that&nbsp;it&nbsp;can't&nbsp;find&nbsp;a&nbsp;geometry&nbsp;column.&nbsp;I&nbsp;have&nbsp;verified&nbsp;that&nbsp;I&nbsp;have&nbsp;permissions&nbsp;to&nbsp;the&nbsp;table,&nbsp;that&nbsp;the&nbsp;connection&nbsp;string&nbsp;is&nbsp;working.&nbsp;The&nbsp;view&nbsp;itself&nbsp;is&nbsp;working&nbsp;and&nbsp;does&nbsp;return&nbsp;a&nbsp;geoGraphy&nbsp;column.

Could&nbsp;that&nbsp;be&nbsp;an&nbsp;issue?&nbsp;I&nbsp;have&nbsp;several&nbsp;tables&nbsp;that&nbsp;I'm&nbsp;referencing&nbsp;now&nbsp;and&nbsp;they&nbsp;each&nbsp;have&nbsp;a&nbsp;geography&nbsp;column.

Thanks&nbsp;for&nbsp;the&nbsp;help.

Kimberly

---

<div class="post-metadata">

**Author:** ![Kimberly](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kimberly](https://community.thinkgeo.com/u/Kimberly)\
**Post date:** [September 14, 2009, 3:18pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/6 "2009-09-14T15:18:15Z")

</div>

David,&nbsp;I&nbsp;thought&nbsp;I&nbsp;should&nbsp;mention&nbsp;as&nbsp;few&nbsp;more&nbsp;things&nbsp;I&nbsp;have&nbsp;tested.&nbsp;My&nbsp;view&nbsp;is&nbsp;only&nbsp;limiting&nbsp;the&nbsp;results&nbsp;from&nbsp;a&nbsp;single&nbsp;table,&nbsp;meaning&nbsp;there&nbsp;are&nbsp;no&nbsp;joins&nbsp;in&nbsp;the&nbsp;view.&nbsp;If&nbsp;I&nbsp;reference&nbsp;the&nbsp;table&nbsp;directly&nbsp;from&nbsp;the&nbsp;code&nbsp;(in&nbsp;place&nbsp;of&nbsp;the&nbsp;view),&nbsp;I&nbsp;get&nbsp;a&nbsp;layer&nbsp;that&nbsp;has&nbsp;all&nbsp;the&nbsp;records&nbsp;in&nbsp;the&nbsp;table&nbsp;and&nbsp;no&nbsp;error.&nbsp;I&nbsp;changed&nbsp;the&nbsp;connection&nbsp;string&nbsp;to&nbsp;that&nbsp;of&nbsp;a&nbsp;different&nbsp;database&nbsp;that&nbsp;doesn't&nbsp;have&nbsp;the&nbsp;view,&nbsp;and&nbsp;I&nbsp;still&nbsp;get&nbsp;the&nbsp;same&nbsp;error&nbsp;message.&nbsp;(Sorry&nbsp;to&nbsp;keep&nbsp;harping&nbsp;on&nbsp;the&nbsp;error&nbsp;message&nbsp;not&nbsp;being&nbsp;helpful.)

Error&nbsp;message:&nbsp;'Can&nbsp;not&nbsp;find&nbsp;the&nbsp;geometry&nbsp;column.'

Stack&nbsp;trace:&nbsp;"&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.MsSql2008FeatureSource.OpenCore()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.FeatureSource.Open()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.FeatureLayer.OpenCore()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.Layer.Open()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas&nbsp;canvas)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas&nbsp;canvas)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x5e1f8125aa040824(Object&nbsp;x2680f14bfcc5c488)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.WaitCallback\_Context(Object&nbsp;state)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.runTryCode(Object&nbsp;userData)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode&nbsp;code,&nbsp;CleanupCode&nbsp;backoutCode,&nbsp;Object&nbsp;userData)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.RunInternal(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.Run(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.PerformWaitCallbackInternal(\_ThreadPoolWaitCallback&nbsp;tpWaitCallBack)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.PerformWaitCallback(Object&nbsp;state)"

Stack&nbsp;trace&nbsp;when&nbsp;running&nbsp;in&nbsp;single&nbsp;threaded&nbsp;mode:&nbsp;(Not&nbsp;sure,&nbsp;but&nbsp;since&nbsp;it's&nbsp;different,&nbsp;maybe&nbsp;it&nbsp;will&nbsp;help.)

"&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.MsSql2008FeatureSource.OpenCore()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.FeatureSource.Open()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.FeatureLayer.OpenCore()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.Layer.Open()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas&nbsp;canvas)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas&nbsp;canvas)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x5e1f8125aa040824(Object&nbsp;x2680f14bfcc5c488)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x958228b8a7148f83()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x5c390bc16fa1868b(Object&nbsp;xd9272088e65bd176,&nbsp;EventArgs&nbsp;xc2fd4c0ed406cdb7)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Timer.OnTick(EventArgs&nbsp;e)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message&&nbsp;m)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr&nbsp;hWnd,&nbsp;Int32&nbsp;msg,&nbsp;IntPtr&nbsp;wparam,&nbsp;IntPtr&nbsp;lparam)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&&nbsp;msg)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32&nbsp;dwComponentID,&nbsp;Int32&nbsp;reason,&nbsp;Int32&nbsp;pvLoopData)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32&nbsp;reason,&nbsp;ApplicationContext&nbsp;context)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32&nbsp;reason,&nbsp;ApplicationContext&nbsp;context)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.Run(Form&nbsp;mainForm)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;AWARE.Program.Main()&nbsp;in&nbsp;C:\\Repository\\AWARE\\Program.cs:line&nbsp;20\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.AppDomain.\_nExecuteAssembly(Assembly&nbsp;assembly,&nbsp;String[]&nbsp;args)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.AppDomain.ExecuteAssembly(String&nbsp;assemblyFile,&nbsp;Evidence&nbsp;assemblySecurity,&nbsp;String[]&nbsp;args)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ThreadHelper.ThreadStart\_Context(Object&nbsp;state)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.runTryCode(Object&nbsp;userData)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode&nbsp;code,&nbsp;CleanupCode&nbsp;backoutCode,&nbsp;Object&nbsp;userData)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.RunInternal(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.Run(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)\r\n&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ThreadHelper.ThreadStart()"

Thanks!

Kimberly

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [September 15, 2009, 12:21am UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/7 "2009-09-15T00:21:12Z")

</div>

Kimberly,

Just&nbsp;want&nbsp;to&nbsp;let&nbsp;you&nbsp;know&nbsp;that&nbsp;when&nbsp;using&nbsp;the&nbsp;Geography&nbsp;data,&nbsp;there&nbsp;was&nbsp;a&nbsp;bug,&nbsp;this&nbsp;will&nbsp;probably&nbsp;cause&nbsp;your&nbsp;problem.  
  
[gis.thinkgeo.com/Support/Dis...aspx#11230](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/11/aft/6286/afv/topic/afpgj/1/Default.aspx#11230)

Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
  
Thanks.

Yale

&nbsp;

---

<div class="post-metadata">

**Author:** ![Kimberly](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kimberly](https://community.thinkgeo.com/u/Kimberly)\
**Post date:** [September 15, 2009, 11:09am UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/8 "2009-09-15T11:09:52Z")

</div>

I’m&nbsp;sorry,&nbsp;but&nbsp;I’m&nbsp;absolutely&nbsp;confused&nbsp;by&nbsp;this.&nbsp;In&nbsp;the&nbsp;past,&nbsp;I&nbsp;had&nbsp;some&nbsp;tables&nbsp;that&nbsp;had&nbsp;geometry&nbsp;columns&nbsp;and&nbsp;when&nbsp;I&nbsp;debugged,&nbsp;all&nbsp;the&nbsp;records&nbsp;showed&nbsp;up,&nbsp;but&nbsp;they&nbsp;weren’t&nbsp;showing&nbsp;on&nbsp;the&nbsp;map.&nbsp;I&nbsp;converted&nbsp;them&nbsp;all&nbsp;to&nbsp;geography&nbsp;and&nbsp;they&nbsp;all&nbsp;started&nbsp;appearing&nbsp;just&nbsp;fine.&nbsp;That’s&nbsp;still&nbsp;true&nbsp;today.&nbsp;The&nbsp;only&nbsp;time&nbsp;it’s&nbsp;not&nbsp;working&nbsp;for&nbsp;me&nbsp;is&nbsp;when&nbsp;trying&nbsp;to&nbsp;reference&nbsp;that&nbsp;same&nbsp;column&nbsp;through&nbsp;a&nbsp;view.&nbsp;Now&nbsp;you’re&nbsp;saying&nbsp;this&nbsp;won’t&nbsp;work&nbsp;unless&nbsp;I&nbsp;convert&nbsp;it&nbsp;all&nbsp;to&nbsp;geometry?&nbsp;What’s&nbsp;the&nbsp;deal?&nbsp;&nbsp;  
&nbsp;Kimberly

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 15, 2009, 11:31am UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/9 "2009-09-15T11:31:38Z")

</div>

Kimberly,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;all&nbsp;he&nbsp;is&nbsp;saying&nbsp;is&nbsp;that&nbsp;we&nbsp;have&nbsp;a&nbsp;bug.&nbsp;&nbsp;I&nbsp;will&nbsp;ensure&nbsp;we&nbsp;get&nbsp;this&nbsp;working&nbsp;with&nbsp;views&nbsp;and&nbsp;not&nbsp;with&nbsp;geometry&nbsp;and&nbsp;geography.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![Kimberly](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kimberly](https://community.thinkgeo.com/u/Kimberly)\
**Post date:** [September 15, 2009, 1:05pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/10 "2009-09-15T13:05:24Z")

</div>

Thank&nbsp;you&nbsp;David!&nbsp;I&nbsp;appreciate&nbsp;the&nbsp;quick&nbsp;and&nbsp;precise&nbsp;answer!

Kimberly

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 15, 2009, 1:17pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/11 "2009-09-15T13:17:23Z")

</div>

Kimberly,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;Don’t&nbsp;thank&nbsp;me&nbsp;just&nbsp;yet&nbsp;we&nbsp;still&nbsp;have&nbsp;to&nbsp;pull&nbsp;it&nbsp;off!&nbsp;:-)&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [September 16, 2009, 4:49pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/12 "2009-09-16T16:49:37Z")

</div>

Kimberly,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;The&nbsp;changes&nbsp;have&nbsp;been&nbsp;integrated&nbsp;in&nbsp;the&nbsp;latest&nbsp;build.&nbsp;&nbsp;Please&nbsp;contact&nbsp;support&nbsp;and&nbsp;ask&nbsp;for&nbsp;build&nbsp;418.&nbsp;&nbsp;The&nbsp;changes&nbsp;should&nbsp;cover&nbsp;the&nbsp;Geometry&nbsp;vs&nbsp;Geography&nbsp;and&nbsp;also&nbsp;the&nbsp;views&nbsp;usage&nbsp;for&nbsp;SQL&nbsp;2008.&nbsp;&nbsp;It&nbsp;also&nbsp;handles&nbsp;the&nbsp;Postgre&nbsp;schema&nbsp;issues.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David

---

<div class="post-metadata">

**Author:** ![Kimberly](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@Kimberly](https://community.thinkgeo.com/u/Kimberly)\
**Post date:** [September 18, 2009, 5:49pm UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/13 "2009-09-18T17:49:04Z")

</div>

Hello,&nbsp;I&nbsp;was&nbsp;able&nbsp;to&nbsp;get&nbsp;build&nbsp;418&nbsp;from&nbsp;support.&nbsp;Thank&nbsp;you&nbsp;for&nbsp;that.&nbsp;It&nbsp;did&nbsp;fix&nbsp;the&nbsp;issue&nbsp;with&nbsp;views&nbsp;not&nbsp;showing&nbsp;and&nbsp;giving&nbsp;the&nbsp;error&nbsp;about&nbsp;the&nbsp;geometry&nbsp;column.&nbsp;But&nbsp;now&nbsp;I&nbsp;have&nbsp;another&nbsp;issue.&nbsp;Just&nbsp;by&nbsp;installing&nbsp;the&nbsp;new&nbsp;version,&nbsp;with&nbsp;no&nbsp;other&nbsp;changes,&nbsp;the&nbsp;map&nbsp;load&nbsp;time&nbsp;went&nbsp;from&nbsp;less&nbsp;than&nbsp;10&nbsp;seconds&nbsp;(usually&nbsp;about&nbsp;5)&nbsp;to&nbsp;now&nbsp;somewhere&nbsp;between&nbsp;3&nbsp;minutes&nbsp;and&nbsp;15&nbsp;seconds&nbsp;to&nbsp;3&nbsp;minutes&nbsp;and&nbsp;45&nbsp;seconds.&nbsp;Panning&nbsp;now,&nbsp;which&nbsp;before&nbsp;was&nbsp;nearly&nbsp;instantaneous,&nbsp;takes&nbsp;a&nbsp;full&nbsp;minute&nbsp;to&nbsp;show&nbsp;the&nbsp;updated&nbsp;areas&nbsp;of&nbsp;the&nbsp;map&nbsp;control.&nbsp;I&nbsp;implemented&nbsp;the&nbsp;tile&nbsp;caching&nbsp;based&nbsp;on&nbsp;the&nbsp;example&nbsp;in&nbsp;the&nbsp;developer&nbsp;reference,&nbsp;but&nbsp;that&nbsp;didn't&nbsp;seem&nbsp;to&nbsp;make&nbsp;much&nbsp;different.&nbsp;I&nbsp;haven't&nbsp;had&nbsp;much&nbsp;time&nbsp;to&nbsp;play&nbsp;with&nbsp;that&nbsp;yet&nbsp;though.&nbsp;I'm&nbsp;wondering&nbsp;if&nbsp;there's&nbsp;just&nbsp;some&nbsp;random&nbsp;other&nbsp;issue&nbsp;that&nbsp;accidentally&nbsp;got&nbsp;through&nbsp;in&nbsp;the&nbsp;dll&nbsp;set&nbsp;or&nbsp;something.&nbsp;(Maybe&nbsp;that&nbsp;doesn't&nbsp;even&nbsp;make&nbsp;sense,&nbsp;but&nbsp;I&nbsp;can't&nbsp;imagine&nbsp;this&nbsp;being&nbsp;a&nbsp;known&nbsp;issue.)&nbsp;Is&nbsp;there&nbsp;something&nbsp;I&nbsp;need&nbsp;to&nbsp;do&nbsp;drastically&nbsp;different&nbsp;with&nbsp;the&nbsp;new&nbsp;version?&nbsp;What&nbsp;are&nbsp;your&nbsp;thoughts&nbsp;on&nbsp;the&nbsp;matter?

Thank&nbsp;you,

Kimberly

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [September 21, 2009, 1:15am UTC](https://community.thinkgeo.com/t/using-sql-view-as-basis-for-mssqlfeaturelayer/658/14 "2009-09-21T01:15:04Z")

</div>

Kimberly,

For&nbsp;this&nbsp;public&nbsp;release(3.0.415),&nbsp;our&nbsp;main&nbsp;enhancement&nbsp;is&nbsp;on&nbsp;the&nbsp;performance&nbsp;improvement&nbsp;compare&nbsp;to&nbsp;last&nbsp;public&nbsp;release.&nbsp;I&nbsp;was&nbsp;embrassed&nbsp;to&nbsp;see&nbsp;it&nbsp;would&nbsp;take&nbsp;3&nbsp;minutes&nbsp;to&nbsp;load&nbsp;the&nbsp;map.&nbsp;Could&nbsp;you&nbsp;give&nbsp;me&nbsp;more&nbsp;information&nbsp;to&nbsp;recreate&nbsp;your&nbsp;problem?&nbsp;How&nbsp;many&nbsp;layers&nbsp;are&nbsp;you&nbsp;loading&nbsp;when&nbsp;this&nbsp;case&nbsp;happened?&nbsp;And&nbsp;could&nbsp;you&nbsp;find&nbsp;the&nbsp;one&nbsp;which&nbsp;take&nbsp;the&nbsp;majority&nbsp;of&nbsp;time&nbsp;to&nbsp;load&nbsp;and&nbsp;create&nbsp;a&nbsp;simple&nbsp;sample&nbsp;for&nbsp;us?&nbsp;

Following&nbsp;code&nbsp;shows&nbsp;the&nbsp;way&nbsp;to&nbsp;use&nbsp;the&nbsp;Geography&nbsp;view,&nbsp;here&nbsp;the&nbsp;States1&nbsp;is&nbsp;a&nbsp;Geography&nbsp;datatable&nbsp;imported&nbsp;from&nbsp;States.shp.  
`string connectString = "Data Source=192.168.0.191;Initial Catalog=InternalDB;Persist Security Info=True;User ID=sa;Password=akeypmon1";MsSql2008FeatureLayer sql2008Layer = new MsSql2008FeatureLayer(connectString, "States1", "ID");sql2008Layer.Open();sql2008Layer.ExecuteNonQuery("create view Statesview as select RECID, geom from States1 where FEMALES > '1000000' ;");winformsMap1.CurrentExtent = sql2008Layer.GetBoundingBox();winformsMap1.CurrentExtent.ScaleDown(50);sql2008Layer.Close();sql2008Layer = new MsSql2008FeatureLayer(connectString, "Statesview", "RECID");sql2008Layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;sql2008Layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;winformsMap1.StaticOverlay.Layers.Add("Sql2008Layer", sql2008Layer);       winformsMap1.Refresh();`  
&nbsp;  
  
Sorry&nbsp;for&nbsp;the&nbsp;inconvinience.  
&nbsp;  
Thanks.  
&nbsp;  
Yale  
  
&nbsp;
