This project has moved and is read-only. For the latest updates, please go here.

Draw a multiple points on my the map by retrieving from database

Jan 12, 2009 at 7:39 AM
Hello All,
I am relatively new to SharpMap I want to draw a many points by retrieving from database After I press the Playback button. But the problem is it draws the last point And Ignores the other.
If you have any idea about this please help me.
The Code I have written is as follows

protected void PlaybackButton_Click(object sender, EventArgs e)
        string conn = ConfigurationManager.ConnectionStrings["LocationConnectionString"].ConnectionString;
        SqlConnection myConnection = new SqlConnection(conn);

        SqlCommand myCommand = new SqlCommand();
        myCommand.Connection = myConnection;
        SqlDataReader myReader;



            myCommand.CommandText = "SELECT * FROM LocationTab;";
            myReader = myCommand.ExecuteReader();
            while (myReader.Read())
                longitude = Convert.ToDouble(myReader["Lat"]);
                latitude = Convert.ToDouble(myReader["Long"]);
                location = display.DrawPoint(longitude, latitude);

        catch (Exception err)
            Response.Write( err.Message);


 Best regards

Jan 12, 2009 at 9:28 AM
Hi halson, It looks like a better solution may be to use the OleDbPoint provider, that way you dont need to manually draw your feature. Otherwise you could read all your features into a FeatureDataTable and use a GeometryProvider to render them.
hth jd
Jan 15, 2009 at 2:22 PM
tnxs Jd for ur quick response. Can plz explain to me what OleDbPoint provider is? Is it included with the SharpMap dll or do  I have to download separtely? If u have sample how to use it plz post it
  thank u agian
Jan 15, 2009 at 4:02 PM
Edited Jan 15, 2009 at 4:44 PM
(edit) It is in the SharpMap project which is in the trunk of the source hth jd
Feb 26, 2009 at 4:09 PM
Hi Halson,

 i have similar kind of requirement. did u get any solution for this?