Skip to content

Geomap with SQl table

Laxman Sharma

Asked Aug 4, 2015, 11:46 PM EDT1 answer
Share
LinkedInX
Hello Sir ,
I am working on google chart and developing a application for the geomap ,I am fetching the data form the SQl table .Everything I am doing correct even system is not showing any error while debugging but Map is not displaying :My code is as under :
.aspx page :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="testchart.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
.aspx.cs
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Services;

namespace testchart
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        // Pie chart
        [WebMethod]
        public static List GetgeomapData()
        {
            DataTable dt = new DataTable();
            using (SqlConnection con = new SqlConnection(@"Data Source=Data-SERVER;Initial Catalog=GISDATABASE;Integrated Security=True"))
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("select *from TestTable", con);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);
                con.Close();
            }
            List dataList = new List();
            foreach (DataRow dtrow in dt.Rows)
            {
                employeeDetails details = new employeeDetails();
                details.EmployeeCity = dtrow[0].ToString();
                details.FIC = Convert.ToInt32(dtrow[1]);
                dataList.Add(details);
            }
            return dataList;
        }
        public class employeeDetails
        {

            public string EmployeeCity { get; set; }


            public object Value { get; set; }



            public string MIROUND { get; set; }

            public int FIC { get; set; }
        }
    }
}

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Quick help is really appreciable ,I am stuck out in this .
    0