ThinkGeo.com    |     Documentation    |     Premium Support

SQL-Request to a PostgreLayer doesn't work

Hi ben,


I'm sorry that I found again a new problem with Postgre Layers.


I tried the example "ExecuteASQLQuery" with a own shapelayer and it is going (but not on an indexed column).


If I try a SQL-Request to a Postgrelayer I get the error -->


Executing sql queries is not supported and the user should always check the CanExecuteSqlQueries to ensure the FeatureSource support it before calling.


I would be thankfull for a hint.


Regards Jörg


Protected Sub btnExecute_Click(ByVal sender As Object, ByVal e As EventArgs) 'Dim sqlLayer As ShapeFileFeatureLayer = DirectCast(Map1.StaticOverlay.Layers("MAZLayer"), ShapeFileFeatureLayer) Dim sqllayer As PostgreSqlFeatureLayer = DirectCast(Map1.StaticOverlay.Layers("MAZLayer"), PostgreSqlFeatureLayer) sqllayer.Open() Dim dataTable As DataTable = sqllayer.QueryTools.ExecuteQuery(SQLTextBox.Text) sqllayer.Close() FeaturesGridView.DataSource = dataTable FeaturesGridView.DataBind() End Sub 



475-Unser_Test.aspx.vb (12.3 KB)
477-Unser_Test.aspx.designer.vb (6.41 KB)

Joerg, 
  
 PostGre doesn’t support ExecuteSqlQueries, we are working on it and it might be available in the next version, sorry for the inconvenience now. 
  
 If you are interested, you can create your own PostGreLayer/PostGreFeatureSource, overwrite the CanExecuteSqlQueries property to true and add your own SqlQuery logic.  
  
 Thanks, 
  
 Ben