private void DisplayMap_Load(object sender, EventArgs e) { ......... (sql2008Layer.FeatureSource as MsSql2008FeatureSource).ExecutingSqlStatement += new EventHandler(DisplayShapeMap_ExecutingSqlStatement); sql2008Layer.CustomGeometryColumnName = YourGeometryColumnNameCorrespondingToSpatialIndexName; ........... } private int counter = 0; private string indexname = yourspatialindexname; void DisplayShapeMap_ExecutingSqlStatement(object sender, ExecutingSqlStatementMsSql2008FeatureSourceEventArgs e) { if (e.ExecutingSqlStatementType == ExecutingSqlStatementType.BuildIndex) { if (counter == 1) { string addedSql = "And sys.indexes.name='" + indexname + "';"; e.SqlStatement = e.SqlStatement.Replace(";", addedSql); } counter++; } }