Chanel 9 | Rx Workshop: Unified Programming Model

Posted August 2nd, 2011 in .NET, Quick posts, Reminders by admin

Learn how to wrap existing event sources, including tasks, asynchronous methods, .NET events, etc. in observable sequences.

SqlServer : Saving changes is not permitted

Posted July 27th, 2010 in Reminders, Sql Server by Sam Beauvois

With SqlServer, when you want to change the structure of a table, you may encounter the following warning message :

“Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.”

warn1

To avoid this warning message, go to the “tools” menu, then click “Options”

toolsoptionsClick on the “Designer” node

Designers

Then  uncheck the “Prevent saving changes that require table re-creation” checkbox

uncheck
And you are done, the message box will not appears anymore

Get the parent Folder for a SPListItem

Posted February 18th, 2010 in Extension Methods, Reminders, Sharepoint by Sam Beauvois

To retrieve the parent folder

my extension method


public static SPFolder GetParentFolder(this SPListItem spListItem)

{

if (spListItem == null)

return null;

SPFile spFile = spListItem.Web.GetFile(spListItem.Url);

if (spFile == null)

return null;

return spFile.ParentFolder;

}

Use


SPFolder parentFolder = sPListItem.GetParentFolder();

if (parentFolder != null)

{

// do some stuffs..

}
public static SPFolder GetParentFolder(this SPListItem spListItem)
{
if (spListItem == null)
return null;
SPFile spFile = spListItem.Web.GetFile(spListItem.Url);
if (spFile == null)
return null;
return spFile.ParentFolder;
}[/csharp]