public static string GetBadgeImagePath(Statistic stat, int badgeLevel) { using (SqlConnection connection = ConnectionManager.GetConnection()) { var data = new ActivEarthDataProvidersDataContext(connection); return (from c in data.BadgeConstantsDataProviders where c.statistic == (byte)stat && c.level == badgeLevel select c.image_path).FirstOrDefault(); } }