Bonjour,
Voila mon code, j'utilise google map pour afficher les régions :
Mais un message erreur s'affiche pour la ligne en rouge
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 public void conn() { System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("Data Source=farah-pc;Initial Catalog=ITS_NI;User ID=sa;Password=*****"); System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT CODE_LOC,Lat,Long FROM LOCALISATION", conn); conn.Open(); System.Data.SqlClient.SqlDataReader dtr = cmd.ExecuteReader(); while (dtr.Read()) { GLatLng latlng = new GLatLng((double)dtr["Lat"],(double)dtr["Long"] ); GMap1.setCenter(latlng, 6, GMapType.GTypes.Hybrid); GMarker marker1 = new GMarker(latlng); GInfoWindowOptions IWoptions = new GInfoWindowOptions(12, GMapType.GTypes.Normal); GShowMapBlowUp mbUp = new GShowMapBlowUp(marker1, false, IWoptions); GMap1.addShowMapBlowUp(mbUp); GMap1.addGMarker(new GMarker(latlng + new GLatLng(2, 1)));<<<@!1!@>>>Merci de m'aider.System.InvalidCastException: Le cast spécifié n'est pas valide
Partager