I have just got my Gmap control working and have implemented it as part of a form where the user inputs their location for the event they are planning (it's a book club meeting website) and a little google maps preview pops up with their location and the
placemarker. I would like to insert the coordinates of the address that they have just entered into the database and retrieve those coordinates at a later date.
I hope someone here is familiar with Subgurim GMap as I'm definitely not!
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim conn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("BookMeetConnString").ConnectionString)
conn.Open()
Dim cmd As New OleDbCommand("INSERT INTO Events (EventTitle, EventDescription, EventDate, EventCategory, CreatedBy, Coordinates) VALUES (@f1,@f2,@f3,@f4,@f5,@f6)", conn)
cmd.Parameters.AddWithValue("@f1", tb_eventtitle.Text)
cmd.Parameters.AddWithValue("@f2", tb_eventdescription.Text)
cmd.Parameters.AddWithValue("@f3", DateTime.ParseExact(tb_eventdate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture))
cmd.Parameters.AddWithValue("@f4", dd_eventcategory.SelectedIndex + 1)
cmd.Parameters.AddWithValue("@f5", User.Identity.Name)
cmd.Parameters.AddWithValue("@f6", GMap1.getGMapEleme
cmd.ExecuteNonQuery()
conn.Close()
Response.Redirect("calendar.aspx")
End Sub
As you can see, I haven't got very far with the Gmap (@f6) parameter. This is where you guys come in!
VB.NET responses preferred!, or error-free C# will suffice as long as I can convert it!
Member
1 Points
7 Posts
Subgurim GMap Control: Pulling Coordinates of "Placemarker" and inserting them into a database
Apr 10, 2013 10:45 PM|adaam2|LINK
I have just got my Gmap control working and have implemented it as part of a form where the user inputs their location for the event they are planning (it's a book club meeting website) and a little google maps preview pops up with their location and the placemarker. I would like to insert the coordinates of the address that they have just entered into the database and retrieve those coordinates at a later date.
I hope someone here is familiar with Subgurim GMap as I'm definitely not!
Anyway here is my client side code:
And here is my subroutine:
As you can see, I haven't got very far with the Gmap (@f6) parameter. This is where you guys come in!
VB.NET responses preferred!, or error-free C# will suffice as long as I can convert it!
Thanks in advance,
Adam