Friday, June 27, 2008
How to get a top level domain name
http://www.praxagora.com/andyo/professional/icann_tld_approval.html
I can only hope it is that easy.
Thursday, June 26, 2008
Unable to instantiate event handler Request registry access is not allowed
So if the app pool account doesn't have access to the registry then it's probably possible that this is the reason registry access is not allowed. To fix this I gave the app pool account admin privledges on the server and retried. This fixed the problem.
Event manager error: Unable to instantiate event handler (assembly "EventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=", class "EventHandler"), or report event for ".xml" in ". Requested registry access is not allowed.
SPFile.CopyTo SPFile.MoveTo How to move a file across SharePoint sites programmatically
Well we need to use the SPFileCollection.Add method as demonstrated below. Sure it's not as easy as a one liner but it gets the job done just the same and more importantly it lets you do it between sites and site collections.
//copy the file to another site document library
using (SPSite spSite = new SPSite("http://destination site url/"))
{
string destinationUrl = "some destination url/" + spFile.Name;
SPFileCollection spFiles = spSite.AllWebs["site relative url"].GetFolder("Doc Lib Name").Files;
byte[] bFile = spFile.OpenBinary(); //spFile is the source file
spFiles.Add(destinationUrl, bFile, true);
}
Basically open up your destination site, get the file collection object from the source document library, add the binary representation of the file to the file collection object and that's it.
Wednesday, June 25, 2008
The selected file was not found - InfoPath Form Services
script type="text/javascript" aspnetForm.encoding = "multipart/form-data"; /script
Tuesday, June 24, 2008
Create a Save As dialog box in InfoPath
FileDialog oDialog = new SaveFileDialog();
oDialog.DefaultExt = "xml";
oDialog.Filter = "InfoPath Form (*.xml)*.xml";
if(oDialog.ShowDialog() == DialogResult.OK)
{
string sFilename = oDialog.FileName;
this.SaveAs(sFilename);
}
Update SPListItem without changing Modified Date
SPListItem.SystemUpdate Method (Microsoft.SharePoint)
Updates the database with changes that are made to the list item without effecting changes in the modified time or modified by fields.
Office 2003 Web Parts (Components) Security Prompts
This website uses a data provider that may be unsafe. If you trust the website, click OK, otherwise click Cancel.
This website is using your identity to access a data source. If you trust this website, click OK to continue, otherwise click Cancel.
To get rid of these Enable Access data sources across domains, instead of Prompt set it to Enable. And Automatic logon with current user name and password.