CSharp Demographics Examples

From CDYNE Wiki
Jump to navigation Jump to search

GetIncomeHouseValueByAddress

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetIncomeHouseValueByAddress.WSDL;
 9 
10 namespace GetIncomeHouseValueByAddress
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.IncomeAndHouseValue IAHV = new IncomeAndHouseValue();
18 
19             IAHV = DQ.GetIncomeHouseValueByAddress("505 Independence Parkway","Chesapeake", "VA", "23320", "YOUR LICENSE KEY"); 
20                                                    
21             Console.WriteLine("Error: " + IAHV.ErrorString + "\n" +
22                             "Place ID: " + IAHV.PlaceInformation.PlaceID + "\n" +
23                             "State Abbreviation: " + IAHV.PlaceInformation.StateAbbrev + "\n" +
24                             "Median Income: " + IAHV.MedianIncome + "\n" +
25                             "Median House Value: " + IAHV.MedianHouseValue);
26             Console.ReadLine();
27         }
28     }
29 }

GetLocationInformationByAddress

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetLocationInformationByAddress.WSDL;
 9 
10 namespace GetLocationInformationByAddress
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.SummaryInformation SI = new SummaryInformation();
18 
19             SI = DQ.GetLocationInformationByAddress("505 Independence Parkway","Chesapeake", "VA", "23320", "YOUR LICENSE KEY");
20 
21             Console.WriteLine("Error: " + SI.ErrorString + "\n" +
22                             "Place ID: " + SI.PlaceInformation.PlaceID + "\n" +
23                             "State Abbreviation: " + SI.PlaceInformation.StateAbbrev + "\n" +
24                             "Median Age: " + SI.MedianAge + "\n" +
25                             "Median Income: " + SI.MedianIncome + "\n" +
26                             "Median Rooms in House: " + SI.MedianRoomsInHouse + "\n" +
27                             "Median House Value: " + SI.MedianHouseValue + "\n" +
28                             "Median Vehicles per Household: " + SI.MedianVehicles + "\n" +
29                             "Percentage Never Married: " + SI.MaritalStatusPercentages.NeverMarried + "\n" +
30                             "Percentage Married: " + SI.MaritalStatusPercentages.Married + "\n" +
31                             "Percentage Separated: " + SI.MaritalStatusPercentages.Separated + "\n" +
32                             "Percentage Married (Other): " + SI.MaritalStatusPercentages.MarriedOther + "\n" +
33                             "Percentage Widowed: " + SI.MaritalStatusPercentages.Widowed + "\n" +
34                             "Percentage Divorced: " + SI.MaritalStatusPercentages.Divorced + "\n" +
35                             "Percentage Asian: " + SI.RacePercentages.Asian + "\n" +
36                             "Percentage Black: " + SI.RacePercentages.Black + "\n" +
37                             "Percentage Inidan: " + SI.RacePercentages.Indian + "\n" +
38                             "Percentage Mixed: " + SI.RacePercentages.Mixed + "\n" +
39                             "Percentage Native Hawaiian: " + SI.RacePercentages.NativeHawaiian + "\n" +
40                             "Percentage Other: " + SI.RacePercentages.Other + "\n" +
41                             "Percentage White: " + SI.RacePercentages.White + "\n" +
42                             "Percentage Female: " + SI.GenderPercentages.Female + "\n" +
43                             "Percentage Male: " + SI.GenderPercentages.Male);
44             Console.ReadLine();
45         }
46     }
47 }

GetLocationInformationByLatitudeLongitude

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetLocationInformationByLatitudeLongitude.WSDL;
 9 
10 namespace GetLocationInformationByLatitudeLongitude
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.SummaryInformation SI = new WSDL.SummaryInformation();
18 
19             SI = DQ.GetLocationInformationByLatitudeLongitude(36.761560m, -76.259964m, "YOUR LICENSE KEY");
20 
21             Console.WriteLine("Error: " + SI.ErrorString + "\n" +
22                             "PlaceID: " + SI.PlaceInformation.PlaceID + "\n" +
23                             "State Abbreviation: " + SI.PlaceInformation.StateAbbrev + "\n" +
24                             "Rural: " + SI.PlaceInformation.Rural + "\n" +
25                             "Median Age: " + SI.MedianAge + "\n" +
26                             "Median Income: " + SI.MedianIncome + "\n" +
27                             "Median Rooms in House: " + SI.MedianRoomsInHouse + "\n" +
28                             "Median House Value: " + SI.MedianHouseValue + "\n" +
29                             "Median Vehicles per Household: " + SI.MedianVehicles + "\n" +
30                             "Percentage Never Married: " + SI.MaritalStatusPercentages.NeverMarried + "\n" +
31                             "Percentage Married: " + SI.MaritalStatusPercentages.Married + "\n" +
32                             "Percentage Separated: " + SI.MaritalStatusPercentages.Separated + "\n" +
33                             "Percentage Married (Other): " + SI.MaritalStatusPercentages.MarriedOther + "\n" +
34                             "Percentage Widowed: " + SI.MaritalStatusPercentages.Widowed + "\n" +
35                             "Percentage Divorced: " + SI.MaritalStatusPercentages.Divorced + "\n" +
36                             "Percentage Asian: " + SI.RacePercentages.Asian + "\n" +
37                             "Percentage Black: " + SI.RacePercentages.Black + "\n" +
38                             "Percentage Inidan: " + SI.RacePercentages.Indian + "\n" +
39                             "Percentage Mixed: " + SI.RacePercentages.Mixed + "\n" +
40                             "Percentage Native Hawaiian: " + SI.RacePercentages.NativeHawaiian + "\n" +
41                             "Percentage Other: " + SI.RacePercentages.Other + "\n" +
42                             "Percentage White: " + SI.RacePercentages.White + "\n" +
43                             "Percentage Female: " + SI.GenderPercentages.Female + "\n" +
44                             "Percentage Male: " + SI.GenderPercentages.Male);
45             Console.ReadLine();
46         }
47     }
48 }

GetNeighborhoodAgeGenderFemaleInDataSet

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodAgeGenderFemaleInDataSet.WSDL;
 9 
10 namespace GetNeighborhoodAgeGenderFemaleInDataSet
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodAgeGenderFemaleInDataSet("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetNeighborhoodAgeGenderMaleInDataSet

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodAgeGenderMaleInDataSet.WSDL;
 9 
10 namespace GetNeighborhoodAgeGenderMaleInDataSet
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodAgeGenderMaleInDataSet("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetNeighborhoodAgeInDataSet

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodAgeInDataSet.WSDL;
 9 
10 namespace GetNeighborhoodAgeInDataSet
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodAgeInDataSet("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetNeighborhoodLinguisticIsolation

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodLinguisticIsolation.WSDL;
 9 
10 namespace GetNeighborhoodLinguisticIsolation
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new WSDL.CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodLinguisticIsolation("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetNeighborhoodPlaceofBirthbyCitizenshipStatusInDataset

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodPlaceofBirthbyCitizenshipStatusInDataset.WSDL;
 9 
10 namespace GetNeighborhoodPlaceofBirthbyCitizenshipStatusInDataset
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodPlaceofBirthbyCitizenshipStatusInDataset("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetNeighborhoodRealtyValueInDataSet

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodRealtyValueInDataSet.WSDL;
 9 
10 namespace GetNeighborhoodRealtyValueInDataSet
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodRealtyValueInDataSet("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetNeighborhoodVehiclesPerHouseholdInDataset

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodVehiclesPerHouseholdInDataset.WSDL;
 9 
10 namespace GetNeighborhoodVehiclesPerHouseholdInDataset
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodVehiclesPerHouseholdInDataset("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetNeighborhoodYearStructuresBuilt

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetNeighborhoodYearStructuresBuilt.WSDL;
 9 
10 namespace GetNeighborhoodYearStructuresBuilt
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.CensusInfoWithDataSet CIWDS = new CensusInfoWithDataSet();
18 
19             CIWDS = DQ.GetNeighborhoodYearStructuresBuilt("VA", "0018466");
20 
21             Console.WriteLine("Error: " + CIWDS.ErrorString + "\n" +
22                             "Data: " + CIWDS.CensusDataSet.GetXml());
23             Console.ReadLine();
24         }
25     }
26 }

GetPlaceIDbyAddress

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetPlaceIDbyAddress.WSDL;
 9 
10 namespace GetPlaceIDbyAddress
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.PlaceInfo PI = new WSDL.PlaceInfo();
18 
19             PI = DQ.GetPlaceIDbyAddress("505 Independence Parkway", "Chesapeake", "VA", "23320", "YOUR LICENSE KEY");
20 
21             Console.WriteLine("Error: " + PI.ErrorString + "\n" +
22                             "Place ID: " + PI.PlaceInformation.PlaceID + "\n" +
23                             "State Abbreviation: " + PI.PlaceInformation.StateAbbrev + "\n" +
24                             "Rural: " + PI.PlaceInformation.Rural);
25             Console.ReadLine();
26         }
27     }
28 }

GetPlaceIDbyCensusTractAndBlock

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetPlaceIDbyCensusTractAndBlock.WSDL;
 9 
10 namespace GetPlaceIDbyCensusTractAndBlock
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.PlaceInfo PI = new PlaceInfo();
18 
19             PI = DQ.GetPlaceIDbyCensusTractAndBlock("VA", "0209.01", "2001", "YOUR LICENSE KEY");
20 
21             Console.WriteLine("Error: " + PI.ErrorString + "\n" +
22                             "PlaceID: " + PI.PlaceInformation.PlaceID);
23             Console.ReadLine();
24         }
25     }
26 }

GetSummaryInformationByPlaceID

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using System.Threading.Tasks;
 8 using GetSummaryInformationByPlaceID.WSDL;
 9 
10 namespace GetSummaryInformationByPlaceID
11 {
12     class Program
13     {
14         static void Main(string[] args)
15         {
16             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
17             WSDL.SummaryInformation SI = new WSDL.SummaryInformation();
18 
19             SI = DQ.GetSummaryInformationByPlaceID("VA", "0018466");
20 
21             Console.WriteLine("Error: " + SI.ErrorString + "\n" +
22                             "Place ID: " + SI.PlaceInformation.PlaceID + "\n" +
23                             "State Abbreviation: " + SI.PlaceInformation.StateAbbrev + "\n" +
24                             "Median Age: " + SI.MedianAge + "\n" +
25                             "Median Income: " + SI.MedianIncome + "\n" +
26                             "Median Rooms in House: " + SI.MedianRoomsInHouse + "\n" +
27                             "Median House Value: " + SI.MedianHouseValue + "\n" +
28                             "Median Vehicles per Household: " + SI.MedianVehicles + "\n" +
29                             "Percentage Never Married: " + SI.MaritalStatusPercentages.NeverMarried + "\n" +
30                             "Percentage Married: " + SI.MaritalStatusPercentages.Married + "\n" +
31                             "Percentage Separated: " + SI.MaritalStatusPercentages.Separated + "\n" +
32                             "Percentage Married (Other): " + SI.MaritalStatusPercentages.MarriedOther + "\n" +
33                             "Percentage Widowed: " + SI.MaritalStatusPercentages.Widowed + "\n" +
34                             "Percentage Divorced: " + SI.MaritalStatusPercentages.Divorced + "\n" +
35                             "Percentage Asian: " + SI.RacePercentages.Asian + "\n" +
36                             "Percentage Black: " + SI.RacePercentages.Black + "\n" +
37                             "Percentage Inidan: " + SI.RacePercentages.Indian + "\n" +
38                             "Percentage Mixed: " + SI.RacePercentages.Mixed + "\n" +
39                             "Percentage Native Hawaiian: " + SI.RacePercentages.NativeHawaiian + "\n" +
40                             "Percentage Other: " + SI.RacePercentages.Other + "\n" +
41                             "Percentage White: " + SI.RacePercentages.White + "\n" +
42                             "Percentage Female: " + SI.GenderPercentages.Female + "\n" +
43                             "Percentage Male: " + SI.GenderPercentages.Male);
44             Console.ReadLine();
45         }
46     }
47 }

GetVersion

 1 /*http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System.Collections.Generic;
 4 using System.Linq;
 5 using System.Text;
 6 using System.Threading.Tasks;
 7 using GetVersion.WSDL;
 8 
 9 namespace GetVersion
10 {
11     class Program
12     {
13         static void Main(string[] args)
14         {
15             WSDL.DemographixQuery DQ = new WSDL.DemographixQuery();
16             WSDL.SummaryInformation SI = new WSDL.SummaryInformation();
17 
18             string Version = DQ.GetVersion();
19 
20             Console.WriteLine("Demographics API Version: " + Version);
21 
22             Console.WriteLine();
23         }
24     }
25 }