API Questions on Kentico API.
Version 5.x > API > finding a state by dbo.CMS_State.StateCode View modes: 
User avatar
Certified Developer 11
Certified Developer 11
ryder-bit-wizards - 10/20/2011 5:15:51 PM
   
finding a state by dbo.CMS_State.StateCode
Hello,

I need to create a CMS.SiteProvider.StateInfo object based on a state abbreviation (which corresponds to the dbo.CMS_State.StateCode field). Is this possible?

It looks like it i can only create the object based on the StateID or the StateName.

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 10/23/2011 9:26:07 AM
   
RE:finding a state by dbo.CMS_State.StateCode
Hello,

There is no such overload for the GetStateInfo method because it the StateCode doesn't need to be a unique and therefore, it could happen that you would get more items then just one.

You can always use a custom SQL query and get what you are after: http://devnet.kentico.com/docs/6_0/devguide/data_layer_code_examples.htm

Best regards
Ondrej Vasil