using (SPSite site = new SPSite(SPContext.Current.Site.Url))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["Employee"];
dropSite.DataSource = list.Items.GetDataTable();
dropSite.DataValueField = "Company";
dropSite.DataTextField = "Company";
dropSite.DataBind();
}
}
No comments:
Post a Comment