Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > work with cms tabels View modes: 
User avatar
Member
Member
softtfhco-gmail - 5/31/2013 11:27:40 PM
   
work with cms tabels
hi

Please Guidance me...

how wrok with cms tables in code behind in visual studio 2012..

For example how fill the drop down in c# with cms tables??

Thanks...

User avatar
Kentico Support
Kentico Support
kentico_janh - 6/1/2013 3:02:23 AM
   
RE:work with cms tabels
Hello,

Ok, let's say you have a dropdown list named ddl. All you need is a DataSet ds and specify what column would be for a text and what for a value:

if (!DataHelper.DataSourceIsEmpty(ds))
{
ddl.DataSource = ds.Tables[0].DefaultView;
ddl.DataTextField = "column1";
ddl.DataValueField = "column2";
ddl.DataBind();
}


Best regards,
Jan Hermann