SPDataSource source = new SPDataSource();
source.DataSourceMode = SPDataSourceMode.List;
source.SelectCommand = "<Query><OrderBy><FieldRef Name='ID' Ascending='False' /></OrderBy></Query>";
source.InsertParameters.Add("ListName", "Tasks");
source.InsertParameters.Add("Webs", Objweb.Url);
this.Controls.Add(source);
ddlStatus.DataTextField = "Title";
ddlStatus.DataValueField = "Title";
ddlStatus.DataSource = source;
ddlStatus.DataBind();
source.DataSourceMode = SPDataSourceMode.List;
source.SelectCommand = "<Query><OrderBy><FieldRef Name='ID' Ascending='False' /></OrderBy></Query>";
source.InsertParameters.Add("ListName", "Tasks");
source.InsertParameters.Add("Webs", Objweb.Url);
this.Controls.Add(source);
ddlStatus.DataTextField = "Title";
ddlStatus.DataValueField = "Title";
ddlStatus.DataSource = source;
ddlStatus.DataBind();
No comments:
Post a Comment