silverlight tsql spatial insert wcf reports no error but does not insert
this insert works correctly:
string WKT = "LINESTRING (" + POINTS[0].Longitude.ToString(CultureInfo.InvariantCulture) + " " + POINTS[0].Latitude.ToString(CultureInfo.InvariantCulture); for (int i = 1; i < POINTS.Count; i++) { WKT += ", " + POINTS[i].Longitude.ToString(CultureInfo.InvariantCulture) + " " + POINTS[i].Latitude.ToString(CultureInfo.InvariantCulture); } WKT += ")"; HydroWCF.HydrotamServisClient cli = new HydroWCF.HydrotamServisClient(); cli.ExecuteNonQueryCompleted += new EventHandler<HydroWCF.ExecuteNonQueryCompletedEventArgs>(cli_ExecuteNonQueryCompleted); string q = ""; if (kaydetmeBicimi == "I") { q += " INSERT INTO [HydrotamDB].[dbo].[Kiyi]"; q += " ([BolgePtr]"; q += " ,[Ad]"; q += " ,[Bilgi]"; q += " ,[ZoomLevel])"; q += " VALUES"; q += " (" + bolgeList[cbBolge.SelectedIndex].BolgeID; q += " ,'" + kiyiAdi + "'"; q += " ,'" + WKT + "'"; q += " ," + viewMap.ZoomLevel + ")"; } else { q += " UPDATE [HydrotamDB].[dbo].[Kiyi]"; q += " SET [BolgePtr]= " + bolgeList[cbBolge.SelectedIndex].BolgeID; q += " ,[Ad] = '" + kiyiAdi + "'"; q += " ,[Bilgi] = '" + WKT + "'"; q += " ,[ZoomLevel]=" + +viewMap.ZoomLevel; q += " WHERE ID = " + kiyiList[cbKiyi.SelectedIndex].KiyiID; } cli.ExecuteNonQueryAsync(q);
but this one doesn't:
HydroWCF.HydrotamServisClient cliKaydet = new HydroWCF.HydrotamServisClient(); cliKaydet.ExecuteNonQueryCompleted +=new EventHandler<HydroWCF.ExecuteNonQueryCompletedEventArgs>(cliKaydet_ExecuteNonQueryCompleted); string WKT = "POINT (" + currNokta.NoktaLoc.Longitude.ToString(CultureInfo.InvariantCulture) + " " + currNokta.NoktaLoc.Latitude.ToString(CultureInfo.InvariantCulture); WKT += ")"; string q = ""; q += " INSERT INTO EnerjiNokta(Ad, Yer)"; q += " VALUES( '" + currNokta.NoktaAdi + "', '" + WKT + "' );"; cliKaydet.ExecuteNonQueryAsync(q);
any solution would be appreciated! Second INSERT does not report any error, and when I copy q to sql manager query runs correctly and insert point as expected. TIA
Answers & Comments...
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog