public static string GetCountyNameFromCode(string Code)
{
try
{
using (DatabaseDriver Driver = new DatabaseDriver(DatabaseEngine.Sqlite, ConnectionString))
{
// Fetch country code from Ip2Nation
Driver.Connect();
List<Dictionary<string, object>> Rows = Driver.Query(
"SELECT country FROM ip2nationcountries WHERE iso_code_2 = @P0", Code.ToUpperInvariant()
);
return (Rows.Count == 0) ? Code: Rows[0]["country"].ToString();
}
}
catch
{
return Code;
}
}