countrycode

Esakki raj asked on February 9, 2019 13:49

i am using kentico11.i need CountryTwoLetterCode from CMS_COUNTRY database table.how to write the query.

Correct Answer

Dražen Janjiček answered on February 11, 2019 10:45

In that case simply use:

CountryInfo entity = CountryInfoProvider.GetCountryInfo(YOURID);

If the requested CountryInfo object exists, it will contain all available information, such as the two-letter country code.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on February 9, 2019 15:33

What do you want to get back? Select colomn from table i.e : Select CountryTwoLetterCode From cms_country

0 votesVote for this answer Mark as a Correct answer

Esakki raj answered on February 11, 2019 08:26

write thiscode in cs file

0 votesVote for this answer Mark as a Correct answer

Dražen Janjiček answered on February 11, 2019 09:08

Try this. Add any further columns you might need.

List<CountryInfo> entities = CountryInfoProvider.GetCountries()
        .Columns("CountryID", "CountryTwoLetterCode")
        .ToList();
1 votesVote for this answer Mark as a Correct answer

Esakki raj answered on February 11, 2019 10:41

i have countryID,i want countrytwolettercode corresponding to that countryID.(where condition)

0 votesVote for this answer Mark as a Correct answer

Esakki raj answered on February 11, 2019 10:54

thanks for ur answer..i have created CustomInfoProvider and custominfo class.by using these provider class how can i insert the data into custom table.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.