matt's profileSharepoint Development f...PhotosBlogListsMore ![]() | Help |
Sharepoint Development for BeginnersSharepoint stuff I do at work and other stuff |
||||
|
March 04 Creating a basic custom field that looks up SQL dataprotected override void CreateChildControls() conn = new SqlConnection("Server=(local);Initial Catalog=Lee;User Id=sa;Password=1!Qwerty;"); daCustomers = new SqlDataAdapter("select TerrID, Territory from ListOfTerritories", conn); this.table = new HtmlTable(); HtmlTableRow row = new HtmlTableRow(); HtmlTableCell cell = null; if (this.ControlMode == SPControlMode.Edit || row.Cells.Add(cell); row = new HtmlTableRow(); cell.Controls.Add(this.listBox); base.Controls.Add(table); public override void UpdateFieldValueInItem() try protected override void Render(HtmlTextWriter output) February 25 Creating a custom field that checks another column’s value against itpublic override string GetValidatedString(object value) if (value.ToString().Trim() != "") if (lic.Count != 0) return value.ToString(); February 24 Creating a new Site CollectionAfter a few weeks of Sharepoint programming I realized I had secuirty errors as I used the site under other accounts. One example is creating a Site Collection. SPSecurity.RunWithElevatedPrivileges
(delegate()
{
if (properties.WebUrl == "http://mhlaptop")
{
webApplication.Sites.Add("/sites/" + strTitleValue,
strProjectTitleValue,
"The proposal number is" + strTitleValue,
1033,
"Lee_Opp_Site2",
@"NORTHAMERICA\mherb",
"Administrator",
"anon@anon.com");
}
else if (properties.WebUrl == "http://punkouter-pc")
{
webApplication.Sites.Add("/sites/" + strTitleValue,
strProjectTitleValue,
"The proposal number is" + strTitleValue,
1033,
"Lee_Opp_Site2",
@"punkouter",
"Administrator",
"anon@anon.com");
} February 23 Working with Syncfusion DOCIO and sharepoint todayfor (int i = 0; i < equipmentList.Count; i++) { for (int j = 0; j <= 2; j++) { iwp = iwt[i + 1, j].AddParagraph() as WParagraph; iwp.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center; if (j == 0) { iwtr = iwp.AppendText(equipmentList[i].strEquipment); } if (j == 1) { iwtr = iwp.AppendText(equipmentList[i].strCoverage); } if (j == 2) { iwtr = iwp.AppendText(equipmentList[i].strSchedule); } } } |
||||
|
|