WFA_psychometric_chart.Form1_main.pullComfortZoneInfoSingle C# (CSharp) Method

pullComfortZoneInfoSingle() public method

Pulls the comfortzone parameters such as minTemp,maxTemp,minHum ,maxHum and colorValue
public pullComfortZoneInfoSingle ( string comfortzoneid ) : void
comfortzoneid string
return void
        public void pullComfortZoneInfoSingle(string comfortzoneid)
        {
            listchartComfortZoneInfoSingle.Clear();//resetting the chart list value..
            string tableForComfortZoneDetail = "tbl_" + selectedBuildingList[0].BuildingName + "_comfort_zone_detail";
            string databasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string databaseFile = databasePath + @"\db_psychrometric_project.s3db";
            string connString = @"Data Source=" + databaseFile + ";Version=3;";

            using (SQLiteConnection connection = new SQLiteConnection(connString))
            {
                connection.Open();
                string sql = "select * from " + tableForComfortZoneDetail + " where id='" + comfortzoneid + "'";
                SQLiteCommand command = new SQLiteCommand(sql, connection);
                SQLiteDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    //This is the reading part of the data...
                    listchartComfortZoneInfoSingle.Add(new dataTypeForCF
                    {
                        id = comfortzoneid,
                        name = reader["name"].ToString(),
                        min_temp = reader["min_temp"].ToString(), //this is in string formate
                        max_temp = reader["max_temp"].ToString(),
                        min_hum = reader["min_hum"].ToString(),
                        max_hum = reader["max_hum"].ToString(),
                        colorValue = ColorTranslator.FromHtml(reader["colorValue"].ToString())
                    });
                }
            }

        }
Form1_main