Thursday, December 27, 2007

Custom Search

Tuesday, December 4, 2007

Assigning Lookup Field's value

SPFieldLookup lkupField = listItemHelp.Fields[field.name] as SPFieldLookup;

if (lkupField != null)
{
System.Guid g = new Guid(lkupField.LookupList);
SPList lookupList = webTestSite.Lists[g];
SPQuery query = new SPQuery();
query.Query = ""
+ " " + field.value + "
";

SPListItemCollection Items = lookupList.GetItems(query);
if (Items != null && Items.Count > 0)
{
string Value = Items[0].ID + ";#" + Items[0][lkupField.LookupField];
listItemHelp[field.name] = Value;
}
}

How to initiate the stsadmin from .Net

Process p= new process();
ProcessStartInfo pi = newProcessStartInfo("stsadmin.exe");
pi.Arguments = "-o arguments"
pi.Windowstyle = ProcessWindowStyle.Hidden;
p.startInfo = pi;
p.start();