Jump to content
Software FX Community

gaurav

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by gaurav

  1. i am using a link.xml file to link the sql query returned to my map. My query returns 'United States' as countryname for USA whereas in the label link file (i.e link.xml) has svg text for USA assigned as <svgtext> U.S.A < / svgtext> i changed it to United States so that it my sql results get mapped on to the world countries map... but for united states it aint happening.. is the white space between United and States the problem or am i allowed to define united states with a white space... ? please help .. this is urgent
  2. gaurav

    data to map

    can u please tell me why the data is not being reflected into the map..... the code is as follows string mySelectQuery = "select countryname,sum(ElectricityUse)as electricity from AcctRptdata,country where IdCountryCode=countrycode group by countryname"; SqlConnection conn = new SqlConnection("Data Source=(local);Initial Catalog=DEMO_2;Integrated Security=SSPI"); conn.Open(); SqlDataAdapter adapter = new SqlDataAdapter(); DataSet ds = new DataSet(); adapter.SelectCommand = new SqlCommand(mySelectQuery, conn); adapter.Fill(ds,"AcctRptData,country"); chart1.DataSourceSettings.Fields.Add(new FieldMap("countryname", FieldUsage.Label)); chart1.DataSourceSettings.Fields.Add(new FieldMap("electrcity", FieldUsage.Value)); chart1.DataSource = ds.Tables[0]; chart1.ConditionalAttributes.Clear(); ConditionalAttributes condition1 = new ConditionalAttributes(); ConditionalAttributes condition2 = new ConditionalAttributes(); condition1.Condition.To = 1400000; condition1.Color = Color.Green; condition2.Color = Color.Red; condition2.Condition.From = 1400001; condition2.Condition.To = 7200000; chart1.ConditionalAttributes.Add(condition1); chart1.ConditionalAttributes.Add(condition2); chart1.ConditionalAttributes.Recalculate(); conn.Close();
  3. i am trying to load data from sql to the map as follows : when i try loading the contents of database to map via .cs file as Chart chart1 = new Chart(); protected void Page_Load(object sender, EventArgs e) { Map1.LabelLinkFile = (Path.Combine(Server.MapPath("App_Data"), @"link.xml")); Map1.MapSource = "World\\WorldCountries.svg"; string mySelectQuery = "select countryname,sum(ElectricityUse)as electricity from AcctRptdata,country where IdCountryCode=countrycode group by countryname"; string dataPath = Path.Combine(Server.MapPath("App_Data"), "DEMO_2_DB_2008FEB13.MDF"); string myConnectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0};",dataPath); System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(myConnectionString); System.Data.DataSet ds = new System.Data.DataSet(); System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(mySelectQuery, myConnection); adapter.Fill(ds,"country"); chart1.DataSourceSettings.Fields.Add(new FieldMap("countryname", FieldUsage.Label)); chart1.DataSourceSettings.Fields.Add(new FieldMap("electrcity", FieldUsage.Value)); chart1.ConditionalAttributes.Clear(); ConditionalAttributes condition1 = new ConditionalAttributes(); ConditionalAttributes condition2 = new ConditionalAttributes(); condition1.Condition.To = 1400000; condition1.Color = Color.Green; condition2.Color = Color.Red; condition2.Condition.From = 1400001; condition2.Condition.To = 7200000; chart1.ConditionalAttributes.Add(condition1); chart1.ConditionalAttributes.Add(condition2); chart1.ConditionalAttributes.Recalculate(); } it gives an oledbException(unrecognised db format) at adapter.fill method.... what are we supposed to write at adapter.fill method in those inverted commas in this case ... 2) and when i try loading the sql conents from source instead of .cs file as <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DEMO_2_DB_2008FEB13ConnectionString %>" SelectCommand=" select countryname,sum(ElectricityUse)as electricity from AcctRptdata,country where IdCountryCode=countrycode group by countryname order by electricity"> </asp:SqlDataSource> and the rest of code for .cs file is same as above then only the few countries returned from the query are highlighed in blue color... why is the conditional attributes not being applied to the map in this case... please answer for both the cases. thank u
  4. can u please explain how can i assign data from sql to the map.my query returns (a) countryname and (b)ElectricyUse (Float) . How does chartfx assign data to the map directly . can you provide my with a sample .cs to export data from sql and assign colours to them based on the values returned, because all your examples use results from text files.
  5. can any1 help to adjust data from sql source to map... i am getting confused with the label link file. is it necessary to have exactly the same countries as the links.xml file in sql result data which needs to be adjusted... how does chartfx link the data returned by the sql query to map because when i have certain results reuturned for some countries (not all countries are present in my db) the map(world countries) all turn blue even when i havent specified the value for some countries..... (logically it is null and hence those countries should not have color blue) i am getting confused ... please help me ...
×
×
  • Create New...