The data binding feature of Nevron Map for .NET lets you easily insert additional attributes to map features from a data source. The data binding process passes through the following stages:
The following code demonstrates how to bind a map layer to a Microsoft Access database:
Example Title |
Copy Code
|
---|---|
// Create a data binding source NMapOleDbDataBindingSource source = new NMapOleDbDataBindingSource(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}\..\..\..\Resources\Maps\Sales.mdb"); source.SelectQuery = "SELECT * FROM Sales"; // Create a data binding context NMapDataBindingContext context = new NMapDataBindingContext(); context.AddColumnMatching("CNTRY_NAME", "Country"); context.ColumnsToImport.Add("Sales"); // Perform the data binding countries.DataBind(source, context); |