ajax Json Web Method with amcharts in asp.net -
error: after calling web method map comes blank..no map displaying in page
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link rel="stylesheet" href="ammap/ammap.css" type="text/css" media="all" /> <script src="http://www.amcharts.com/lib/3/amcharts.js" type="text/javascript"></script> <script src="http://www.amcharts.com/lib/3/pie.js" type="text/javascript"></script> <script src="http://www.amcharts.com/lib/3/ammap_amcharts_extension.js" type="text/javascript"></script> <script src="http://www.amcharts.com/lib/maps/js/worldlow.js" type="text/javascript"></script> <script src="https://code.jquery.com/jquery-2.2.1.js" type="text/javascript"></script> <script type="text/javascript"> function createchart() { debugger; var chartdata2 = []; var chartdataresults =[]; $.ajax( { type: 'post', datatype: 'json', contenttype: 'application/json', url: 'amgeochrt.aspx/getdataonload', data: {}, success: function( response ) { var adata = response.d; var id; ( var = 0; <=0; i++ ) { var country = adata[i].costtype; if (country = "cambodia") { id = "kh"; } chartdataresults.push( { "map": "worldlow", "areas": [ { "id": id, "color": "#00cc00" }, { "id": "fr", "color": "#0000cc" }] } ); } // create chart here var map; map = new amcharts.ammap(); map.pathtoimages = "http://www.ammap.com/lib/images/"; var dataprovider = { mapvar: amcharts.maps.worldlow }; map.areassettings = { unlistedareascolor: "#dddddd", rolloveroutlinecolor: "#ffffff", rollovercolor: "#cc0000" }; map.backgroundcolor = "#000000"; debugger; map.dataprovider = chartdataresults; // write map.write("mapdiv"); } } ); } $( document ).ready( createchart ); </script> </head> <body> <div> <div id="mapdiv" style="width: 600px; height: 400px;"></div> </div> </body> </html> [webmethod] public static list<chartdetails> getdataonload() { string constring = system.configuration.configurationmanager.connectionstrings["connectionstring2"].connectionstring.tostring(); using (sqlconnection con = new sqlconnection(constring)) { string totaldata = string.empty; sqlcommand cmd = new sqlcommand("select distinct countryname [trackbycountry] countrycode in('cn','kh','my','th','id','vn','ph')", con); cmd.commandtimeout = 50; con.open(); sqldataadapter da = new sqldataadapter(cmd); //da.selectcommand = cmd; datatable dt = new datatable(); da.fill(dt); con.close(); list<chartdetails> datalist = new list<chartdetails>(); foreach (datarow dtrow in dt.rows) { chartdetails details = new chartdetails(); sqlcommand cmd1 = new sqlcommand("select costtype,totalcount [trackbycountry] countryname='" + dtrow[0].tostring() + "' , totalcount>1 order costtype", con); cmd.commandtimeout = 50; con.open(); sqldataadapter da1 = new sqldataadapter(cmd1); //da.selectcommand = cmd; datatable dt1 = new datatable(); da1.fill(dt1); con.close(); if (dt1.rows.count > 1) { foreach (datarow dtrow1 in dt1.rows) { //totaldata += dtrow1[0].tostring() + dtrow1[1].tostring() +"|"; totaldata += dtrow1[0].tostring() + ":" + dtrow1[1].tostring() + ","; } details.costtype = dtrow[0].tostring(); totaldata = "country:" + dtrow[0].tostring() + "," + totaldata; totaldata = totaldata.substring(0, totaldata.length - 1); //string bal=totaldata.replace("|", char(13)+char(10)"); details.costvalue = totaldata; totaldata = ""; datalist.add(details); } } return datalist; } } class files web method public class chartdetails { public string costtype { get; set; } public string costvalue { get; set; } }
output[1]: http://i.stack.imgur.com/hrwoj.png
retrieving data database javascript maps in amcharts using asp,net, c#
<script type="text/javascript" src="https://www.amcharts.com/lib/3/ammap.js"></script> <script type="text/javascript" src="https://www.amcharts.com/lib/3/maps/js/worldlow.js"></script> <script type="text/javascript" src="https://www.amcharts.com/lib/3/themes/dark.js"></script> <script type="text/javascript" src="http://www.amcharts.com/lib/3/serial.js"></script> <script type="text/javascript" src="http://www.amcharts.com/lib/3/plugins/dataloader/dataloader.min.js"></script> <script src="jsfiles/jquery-1.10.2.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $.ajax({ type: 'post', datatype: 'json', contenttype: 'application/json', url: 'amchartgeochart.aspx/getdataonload', data:{}, success: function (response) { drawvisualization(response.d); } }); function drawvisualization(datavalues) { var latlong = {}; latlong["ad"] = { "latitude": 42.5, "longitude": 1.5 }; latlong["ae"] = { "latitude": 24, "longitude": 54 }; latlong["af"] = { "latitude": 33, "longitude": 65 }; latlong["ag"] = { "latitude": 17.05, "longitude": -61.8 }; latlong["ai"] = { "latitude": 18.25, "longitude": -63.1667 }; latlong["al"] = { "latitude": 41, "longitude": 20 }; latlong["am"] = { "latitude": 40, "longitude": 45 }; latlong["an"] = { "latitude": 12.25, "longitude": -68.75 }; latlong["ao"] = { "latitude": -12.5, "longitude": 18.5 }; latlong["ap"] = { "latitude": 35, "longitude": 105 }; latlong["aq"] = { "latitude": -90, "longitude": 0 }; latlong["ar"] = { "latitude": -34, "longitude": -64 }; latlong["as"] = { "latitude": -14.3333, "longitude": -170 }; latlong["at"] = { "latitude": 47.3333, "longitude": 13.3333 }; latlong["au"] = { "latitude": -27, "longitude": 133 }; latlong["aw"] = { "latitude": 12.5, "longitude": -69.9667 }; latlong["az"] = { "latitude": 40.5, "longitude": 47.5 }; latlong["ba"] = { "latitude": 44, "longitude": 18 }; latlong["bb"] = { "latitude": 13.1667, "longitude": -59.5333 }; latlong["bd"] = { "latitude": 24, "longitude": 90 }; latlong["be"] = { "latitude": 50.8333, "longitude": 4 }; latlong["bf"] = { "latitude": 13, "longitude": -2 }; latlong["bg"] = { "latitude": 43, "longitude": 25 }; latlong["bh"] = { "latitude": 26, "longitude": 50.55 }; latlong["bi"] = { "latitude": -3.5, "longitude": 30 }; latlong["bj"] = { "latitude": 9.5, "longitude": 2.25 }; latlong["bm"] = { "latitude": 32.3333, "longitude": -64.75 }; latlong["bn"] = { "latitude": 4.5, "longitude": 114.6667 }; latlong["bo"] = { "latitude": -17, "longitude": -65 }; latlong["br"] = { "latitude": -10, "longitude": -55 }; latlong["bs"] = { "latitude": 24.25, "longitude": -76 }; latlong["bt"] = { "latitude": 27.5, "longitude": 90.5 }; latlong["bv"] = { "latitude": -54.4333, "longitude": 3.4 }; latlong["bw"] = { "latitude": -22, "longitude": 24 }; latlong["by"] = { "latitude": 53, "longitude": 28 }; latlong["bz"] = { "latitude": 17.25, "longitude": -88.75 }; latlong["ca"] = { "latitude": 54, "longitude": -100 }; latlong["cc"] = { "latitude": -12.5, "longitude": 96.8333 }; latlong["cd"] = { "latitude": 0, "longitude": 25 }; latlong["cf"] = { "latitude": 7, "longitude": 21 }; latlong["cg"] = { "latitude": -1, "longitude": 15 }; latlong["ch"] = { "latitude": 47, "longitude": 8 }; latlong["ci"] = { "latitude": 8, "longitude": -5 }; latlong["ck"] = { "latitude": -21.2333, "longitude": -159.7667 }; latlong["cl"] = { "latitude": -30, "longitude": -71 }; latlong["cm"] = { "latitude": 6, "longitude": 12 }; latlong["cn"] = { "latitude": 35, "longitude": 105 }; latlong["co"] = { "latitude": 4, "longitude": -72 }; latlong["cr"] = { "latitude": 10, "longitude": -84 }; latlong["cu"] = { "latitude": 21.5, "longitude": -80 }; latlong["cv"] = { "latitude": 16, "longitude": -24 }; latlong["cx"] = { "latitude": -10.5, "longitude": 105.6667 }; latlong["cy"] = { "latitude": 35, "longitude": 33 }; latlong["cz"] = { "latitude": 49.75, "longitude": 15.5 }; latlong["de"] = { "latitude": 51, "longitude": 9 }; latlong["dj"] = { "latitude": 11.5, "longitude": 43 }; latlong["dk"] = { "latitude": 56, "longitude": 10 }; latlong["dm"] = { "latitude": 15.4167, "longitude": -61.3333 }; latlong["do"] = { "latitude": 19, "longitude": -70.6667 }; latlong["dz"] = { "latitude": 28, "longitude": 3 }; latlong["ec"] = { "latitude": -2, "longitude": -77.5 }; latlong["ee"] = { "latitude": 59, "longitude": 26 }; latlong["eg"] = { "latitude": 27, "longitude": 30 }; latlong["eh"] = { "latitude": 24.5, "longitude": -13 }; latlong["er"] = { "latitude": 15, "longitude": 39 }; latlong["es"] = { "latitude": 40, "longitude": -4 }; latlong["et"] = { "latitude": 8, "longitude": 38 }; latlong["eu"] = { "latitude": 47, "longitude": 8 }; latlong["fi"] = { "latitude": 62, "longitude": 26 }; latlong["fj"] = { "latitude": -18, "longitude": 175 }; latlong["fk"] = { "latitude": -51.75, "longitude": -59 }; latlong["fm"] = { "latitude": 6.9167, "longitude": 158.25 }; latlong["fo"] = { "latitude": 62, "longitude": -7 }; latlong["fr"] = { "latitude": 46, "longitude": 2 }; latlong["ga"] = { "latitude": -1, "longitude": 11.75 }; latlong["gb"] = { "latitude": 54, "longitude": -2 }; latlong["gd"] = { "latitude": 12.1167, "longitude": -61.6667 }; latlong["ge"] = { "latitude": 42, "longitude": 43.5 }; latlong["gf"] = { "latitude": 4, "longitude": -53 }; latlong["gh"] = { "latitude": 8, "longitude": -2 }; latlong["gi"] = { "latitude": 36.1833, "longitude": -5.3667 }; latlong["gl"] = { "latitude": 72, "longitude": -40 }; latlong["gm"] = { "latitude": 13.4667, "longitude": -16.5667 }; latlong["gn"] = { "latitude": 11, "longitude": -10 }; latlong["gp"] = { "latitude": 16.25, "longitude": -61.5833 }; latlong["gq"] = { "latitude": 2, "longitude": 10 }; latlong["gr"] = { "latitude": 39, "longitude": 22 }; latlong["gs"] = { "latitude": -54.5, "longitude": -37 }; latlong["gt"] = { "latitude": 15.5, "longitude": -90.25 }; latlong["gu"] = { "latitude": 13.4667, "longitude": 144.7833 }; latlong["gw"] = { "latitude": 12, "longitude": -15 }; latlong["gy"] = { "latitude": 5, "longitude": -59 }; latlong["hk"] = { "latitude": 22.25, "longitude": 114.1667 }; latlong["hm"] = { "latitude": -53.1, "longitude": 72.5167 }; latlong["hn"] = { "latitude": 15, "longitude": -86.5 }; latlong["hr"] = { "latitude": 45.1667, "longitude": 15.5 }; latlong["ht"] = { "latitude": 19, "longitude": -72.4167 }; latlong["hu"] = { "latitude": 47, "longitude": 20 }; latlong["id"] = { "latitude": -5, "longitude": 120 }; latlong["ie"] = { "latitude": 53, "longitude": -8 }; latlong["il"] = { "latitude": 31.5, "longitude": 34.75 }; latlong["in"] = { "latitude": 20, "longitude": 77 }; latlong["io"] = { "latitude": -6, "longitude": 71.5 }; latlong["iq"] = { "latitude": 33, "longitude": 44 }; latlong["ir"] = { "latitude": 32, "longitude": 53 }; latlong["is"] = { "latitude": 65, "longitude": -18 }; latlong["it"] = { "latitude": 42.8333, "longitude": 12.8333 }; latlong["jm"] = { "latitude": 18.25, "longitude": -77.5 }; latlong["jo"] = { "latitude": 31, "longitude": 36 }; latlong["jp"] = { "latitude": 36, "longitude": 138 }; latlong["ke"] = { "latitude": 1, "longitude": 38 }; latlong["kg"] = { "latitude": 41, "longitude": 75 }; latlong["kh"] = { "latitude": 13, "longitude": 105 }; latlong["ki"] = { "latitude": 1.4167, "longitude": 173 }; latlong["km"] = { "latitude": -12.1667, "longitude": 44.25 }; latlong["kn"] = { "latitude": 17.3333, "longitude": -62.75 }; latlong["kp"] = { "latitude": 40, "longitude": 127 }; latlong["kr"] = { "latitude": 37, "longitude": 127.5 }; latlong["kw"] = { "latitude": 29.3375, "longitude": 47.6581 }; latlong["ky"] = { "latitude": 19.5, "longitude": -80.5 }; latlong["kz"] = { "latitude": 48, "longitude": 68 }; latlong["la"] = { "latitude": 18, "longitude": 105 }; latlong["lb"] = { "latitude": 33.8333, "longitude": 35.8333 }; latlong["lc"] = { "latitude": 13.8833, "longitude": -61.1333 }; latlong["li"] = { "latitude": 47.1667, "longitude": 9.5333 }; latlong["lk"] = { "latitude": 7, "longitude": 81 }; latlong["lr"] = { "latitude": 6.5, "longitude": -9.5 }; latlong["ls"] = { "latitude": -29.5, "longitude": 28.5 }; latlong["lt"] = { "latitude": 55, "longitude": 24 }; latlong["lu"] = { "latitude": 49.75, "longitude": 6 }; latlong["lv"] = { "latitude": 57, "longitude": 25 }; latlong["ly"] = { "latitude": 25, "longitude": 17 }; latlong["ma"] = { "latitude": 32, "longitude": -5 }; latlong["mc"] = { "latitude": 43.7333, "longitude": 7.4 }; latlong["md"] = { "latitude": 47, "longitude": 29 }; latlong["me"] = { "latitude": 42.5, "longitude": 19.4 }; latlong["mg"] = { "latitude": -20, "longitude": 47 }; latlong["mh"] = { "latitude": 9, "longitude": 168 }; latlong["mk"] = { "latitude": 41.8333, "longitude": 22 }; latlong["ml"] = { "latitude": 17, "longitude": -4 }; latlong["mm"] = { "latitude": 22, "longitude": 98 }; latlong["mn"] = { "latitude": 46, "longitude": 105 }; latlong["mo"] = { "latitude": 22.1667, "longitude": 113.55 }; latlong["mp"] = { "latitude": 15.2, "longitude": 145.75 }; latlong["mq"] = { "latitude": 14.6667, "longitude": -61 }; latlong["mr"] = { "latitude": 20, "longitude": -12 }; latlong["ms"] = { "latitude": 16.75, "longitude": -62.2 }; latlong["mt"] = { "latitude": 35.8333, "longitude": 14.5833 }; latlong["mu"] = { "latitude": -20.2833, "longitude": 57.55 }; latlong["mv"] = { "latitude": 3.25, "longitude": 73 }; latlong["mw"] = { "latitude": -13.5, "longitude": 34 }; latlong["mx"] = { "latitude": 23, "longitude": -102 }; latlong["my"] = { "latitude": 2.5, "longitude": 112.5 }; latlong["mz"] = { "latitude": -18.25, "longitude": 35 }; latlong["na"] = { "latitude": -22, "longitude": 17 }; latlong["nc"] = { "latitude": -21.5, "longitude": 165.5 }; latlong["ne"] = { "latitude": 16, "longitude": 8 }; latlong["nf"] = { "latitude": -29.0333, "longitude": 167.95 }; latlong["ng"] = { "latitude": 10, "longitude": 8 }; latlong["ni"] = { "latitude": 13, "longitude": -85 }; latlong["nl"] = { "latitude": 52.5, "longitude": 5.75 }; latlong["no"] = { "latitude": 62, "longitude": 10 }; latlong["np"] = { "latitude": 28, "longitude": 84 }; latlong["nr"] = { "latitude": -0.5333, "longitude": 166.9167 }; latlong["nu"] = { "latitude": -19.0333, "longitude": -169.8667 }; latlong["nz"] = { "latitude": -41, "longitude": 174 }; latlong["om"] = { "latitude": 21, "longitude": 57 }; latlong["pa"] = { "latitude": 9, "longitude": -80 }; latlong["pe"] = { "latitude": -10, "longitude": -76 }; latlong["pf"] = { "latitude": -15, "longitude": -140 }; latlong["pg"] = { "latitude": -6, "longitude": 147 }; latlong["ph"] = { "latitude": 13, "longitude": 122 }; latlong["pk"] = { "latitude": 30, "longitude": 70 }; latlong["pl"] = { "latitude": 52, "longitude": 20 }; latlong["pm"] = { "latitude": 46.8333, "longitude": -56.3333 }; latlong["pr"] = { "latitude": 18.25, "longitude": -66.5 }; latlong["ps"] = { "latitude": 32, "longitude": 35.25 }; latlong["pt"] = { "latitude": 39.5, "longitude": -8 }; latlong["pw"] = { "latitude": 7.5, "longitude": 134.5 }; latlong["py"] = { "latitude": -23, "longitude": -58 }; latlong["qa"] = { "latitude": 25.5, "longitude": 51.25 }; latlong["re"] = { "latitude": -21.1, "longitude": 55.6 }; latlong["ro"] = { "latitude": 46, "longitude": 25 }; latlong["rs"] = { "latitude": 44, "longitude": 21 }; latlong["ru"] = { "latitude": 60, "longitude": 100 }; latlong["rw"] = { "latitude": -2, "longitude": 30 }; latlong["sa"] = { "latitude": 25, "longitude": 45 }; latlong["sb"] = { "latitude": -8, "longitude": 159 }; latlong["sc"] = { "latitude": -4.5833, "longitude": 55.6667 }; latlong["sd"] = { "latitude": 15, "longitude": 30 }; latlong["se"] = { "latitude": 62, "longitude": 15 }; latlong["sg"] = { "latitude": 1.3667, "longitude": 103.8 }; latlong["sh"] = { "latitude": -15.9333, "longitude": -5.7 }; latlong["si"] = { "latitude": 46, "longitude": 15 }; latlong["sj"] = { "latitude": 78, "longitude": 20 }; latlong["sk"] = { "latitude": 48.6667, "longitude": 19.5 }; latlong["sl"] = { "latitude": 8.5, "longitude": -11.5 }; latlong["sm"] = { "latitude": 43.7667, "longitude": 12.4167 }; latlong["sn"] = { "latitude": 14, "longitude": -14 }; latlong["so"] = { "latitude": 10, "longitude": 49 }; latlong["sr"] = { "latitude": 4, "longitude": -56 }; latlong["st"] = { "latitude": 1, "longitude": 7 }; latlong["sv"] = { "latitude": 13.8333, "longitude": -88.9167 }; latlong["sy"] = { "latitude": 35, "longitude": 38 }; latlong["sz"] = { "latitude": -26.5, "longitude": 31.5 }; latlong["tc"] = { "latitude": 21.75, "longitude": -71.5833 }; latlong["td"] = { "latitude": 15, "longitude": 19 }; latlong["tf"] = { "latitude": -43, "longitude": 67 }; latlong["tg"] = { "latitude": 8, "longitude": 1.1667 }; latlong["th"] = { "latitude": 15, "longitude": 100 }; latlong["tj"] = { "latitude": 39, "longitude": 71 }; latlong["tk"] = { "latitude": -9, "longitude": -172 }; latlong["tm"] = { "latitude": 40, "longitude": 60 }; latlong["tn"] = { "latitude": 34, "longitude": 9 }; latlong["to"] = { "latitude": -20, "longitude": -175 }; latlong["tr"] = { "latitude": 39, "longitude": 35 }; latlong["tt"] = { "latitude": 11, "longitude": -61 }; latlong["tv"] = { "latitude": -8, "longitude": 178 }; latlong["tw"] = { "latitude": 23.5, "longitude": 121 }; latlong["tz"] = { "latitude": -6, "longitude": 35 }; latlong["ua"] = { "latitude": 49, "longitude": 32 }; latlong["ug"] = { "latitude": 1, "longitude": 32 }; latlong["um"] = { "latitude": 19.2833, "longitude": 166.6 }; latlong["us"] = { "latitude": 38, "longitude": -97 }; latlong["uy"] = { "latitude": -33, "longitude": -56 }; latlong["uz"] = { "latitude": 41, "longitude": 64 }; latlong["va"] = { "latitude": 41.9, "longitude": 12.45 }; latlong["vc"] = { "latitude": 13.25, "longitude": -61.2 }; latlong["ve"] = { "latitude": 8, "longitude": -66 }; latlong["vg"] = { "latitude": 18.5, "longitude": -64.5 }; latlong["vi"] = { "latitude": 18.3333, "longitude": -64.8333 }; latlong["vn"] = { "latitude": 16, "longitude": 106 }; latlong["vu"] = { "latitude": -16, "longitude": 167 }; latlong["wf"] = { "latitude": -13.3, "longitude": -176.2 }; latlong["ws"] = { "latitude": -13.5833, "longitude": -172.3333 }; latlong["ye"] = { "latitude": 15, "longitude": 48 }; latlong["yt"] = { "latitude": -12.8333, "longitude": 45.1667 }; latlong["za"] = { "latitude": -29, "longitude": 24 }; latlong["zm"] = { "latitude": -15, "longitude": 30 }; latlong["zw"] = { "latitude": -20, "longitude": 30 }; amcharts.theme = amcharts.themes.dark; window.map = new amcharts.ammap(); window.map.addtitle("traffic geochart", 14); //window.map.addtitle("source: gapminder", 11); window.map.areassettings = { unlistedareascolor: "#000000", unlistedareasalpha: 0.1 }; //window.map.imagessettings.balloontext = "<span style='font-size:14px;'><b>[[title]]</b>: [[value]]</span>"; var val = []; var dataprovider = { mapvar: amcharts.maps.worldlow, images: [] } (var = 0; < datavalues.length; i++) { var dataitem= datavalues[i]; var id = dataitem.countrycode; var costvalue = dataitem.costvalue; var countryname=dataitem.costtype; var icon = "m21.25,8.375v28h6.5v8.375h21.25zm12.25,28h6.5v4.125h-6.5v28zm3.25,28h6.5v12.625h-6.5v28z"; debugger; dataprovider.images.push({ longitude: latlong[id].longitude, latitude: latlong[id].latitude, scale: 0.5, svgpath: icon, label: countryname, color: "green", labelshifty: 2, zoomlevel: 5, title: dataitem.costvalue, description:"welcome amcharts" }); window.map.dataprovider = dataprovider; window.map.export = { enabled: true } window.map.projection = "eckert6"; window.map.write("chartdiv"); } } }) </script> c# [webmethod] public static list<chartdetails> getdataonload() { string constring = system.configuration.configurationmanager.connectionstrings["connectionstring2"].connectionstring.tostring(); using (sqlconnection con = new sqlconnection(constring)) { string totaldata = string.empty; sqlcommand cmd = new sqlcommand("select distinct countryname [trackbycountry] countrycode in('cn','kh','my','th','id','vn','ph')", con); //sqlcommand cmd = new sqlcommand("select * [trackbycountry] totalcount > 100 order countryname"); cmd.commandtimeout = 50; con.open(); sqldataadapter da = new sqldataadapter(cmd); //da.selectcommand = cmd; datatable dt = new datatable(); da.fill(dt); con.close(); list<chartdetails> datalist = new list<chartdetails>(); foreach (datarow dtrow in dt.rows) { chartdetails details = new chartdetails(); sqlcommand cmd1 = new sqlcommand("select costtype,totalcount,countrycode [trackbycountry] countryname='" + dtrow[0].tostring() + "' , totalcount>1 order costtype", con); cmd.commandtimeout = 50; con.open(); sqldataadapter da1 = new sqldataadapter(cmd1); //da.selectcommand = cmd; datatable dt1 = new datatable(); da1.fill(dt1); con.close(); if (dt1.rows.count > 1) { foreach (datarow dtrow1 in dt1.rows) { //totaldata += dtrow1[0].tostring() + dtrow1[1].tostring() +"|"; totaldata += dtrow1[0].tostring() + ":" + dtrow1[1].tostring() + ","; } details.costtype = dtrow[0].tostring(); totaldata = "country:" + dtrow[0].tostring() + "," + totaldata; totaldata = totaldata.substring(0, totaldata.length - 1); //string bal=totaldata.replace("|", char(13)+char(10)"); details.costvalue = totaldata; details.countrycode = dt1.rows[0][2].tostring(); totaldata = ""; datalist.add(details); } } return datalist; } } public class chartdetails { public string costtype { get; set; } public string costvalue { get; set; } public string countrycode { get; set; } }
Comments
Post a Comment