从SQL Server 2008调用数据 [英] call data from sql server 2008
本文介绍了从SQL Server 2008调用数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何调用要显示的数据库,
通过用c3编程asp.net,
由于在编译时出现的问题
how to call the database to be displayed,,
through programming asp.net with c3,,
because of problems that came out at compile time
myLayer.DataSource = new SharpMap.Data.Providers.katmai (ConnStr, "dbo.sysdiagrams", "dbo.Geocode", "OidColumn");
请举个例子,
谢谢你
please give an example at all,,,
thank you
推荐答案
示例:
Example:
SharpMap.Map myMap = new SharpMap.Map(new Size(400,300));
myMap.Size = new System.Drawing.Size(300,200); //Set output size
myMap.MinimumZoom = 100; //Minimum zoom allowed
myMap.BackgroundColor = Color.White; //Set background
myMap.Center = new SharpMap.Geometry.Point(725000, 6180000); //Set center of map
//Add PostGIS layer:
SharpMap.Layers.VectorLayer myLayer = new SharpMap.Layers.VectorLayer("My layer");
string ConnStr = "Server=127.0.0.1;Port=5432;UserId=postgres;Password=password;Database=myGisDb;";
myLayer.DataSource = new SharpMap.Data.Providers.PostGIS(ConnStr, "myTable", "the_geom", 32632);
myLayer.MaxVisible = 40000;
myMap.Layers.Add(myLayer);
//Render the map
////1st possibility: Set zoom level
//myMap.Zoom = 1200; //Set zoom level
//2nd. possibility: Zoom to extents
myMap.ZoomToExtents();
System.Drawing.Image imgMap = myMap.GetMap();
这篇关于从SQL Server 2008调用数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文