Sometime you may find Site.RootWeb.AllUsers didn’t return all users even the user you can find in search. This is because AllUsers shows active users, i.e. those who have interacted with the sitecollection at least once. A quick way to add user in is go to your site collection level (top-level Web site ), clcik advanced permission, then add users in then removed them.
Find a stored procedure containing
Posted by ken zheng on November 10, 2009
Quite often you need to find which stored procedure contains key word. I find this blog and use
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%foobar%'
AND ROUTINE_TYPE='PROCEDURE'
Posted in SQL | Tagged: stored procedure | Leave a Comment »
Fix for ‘The database principal owns a schema in the database, and cannot be dropped’ Error in SQL Server 2005
Posted by ken zheng on November 9, 2009
It happens when you are trying to delete a SQL user. To change the DB_Owner to some another “Database Principal”; simply Drill Down to your Database in Sql Server Management Studio and further more Drill Down to your_DB_Name >Security > Schemas > db_owner > right click > select properties. You would find the name of the “Database Principal” that you want to delete. Change this to some another “Database Principal”; for Example, to “dbo”.
You need to make the same changes to all the schemas where the “Database Principal” is having/owning the role. For Example, if it is having “db_owner, db_datareader, db_datawriter” roles; then you have to make the above said changes for all these 3 schemas.
Posted in SQL | Tagged: SQL Server 2005 | Leave a Comment »
xxx does not implement IReportServerConnection or could not be found at Microsoft.Reporting.WebForms.ConfigFilePropertyInterface in SharePoint
Posted by ken zheng on November 4, 2009
If you create a custom viewer and add in your web.config.
<add key="ReportViewerServerConnection" value= ...>
You will find your Site Ussage report will not working and throw error with your assembly does not implement IReportServerConnection or could not be found. After searching the net and I found Steve’s blog. Although the error is different, the fix is the same.
“The problem is that web config’s are inherited in IIS therefore the reporting services web service web config settings are inherited from the report manager web config which means that the setting you removed is needed for report manager but breaks the web service.”
So to fix the problem, go to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\LAYOUTS and open web.config, add:
<appSettings>
<add key="ReportViewerServerConnection" value="" />
</appSettings>
Posted in Sharepoint | Tagged: SharePoint Report | Leave a Comment »
Easiest Way To Add Custom Page to SharePoint
Posted by ken zheng on November 4, 2009
I found the easiest way to add custom page to SharePoint is to create a host aspx page and embed usercontrol inside, so next time if you have any update you can just update the usercontrol.
Below is the aspx inline page and I upload to Pages library
<%@ Page Language="C#" EnableSessionState="true" MasterPageFile="~masterurl/default.master"%>
<%@ Register src="~/_controltemplates/TestUserControl.ascx" tagname="TestUserControl" tagprefix="uc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<uc1:TestUserControl ID="JDEGLSearch" runat="server" />
</asp:Content>
The TestUserControl.ascx just a User Control created in the visual studio. You can add the ui into 12\TEMPLATE\CONTROLTEMPLATES
or you can add into _\12\TEMPLATE\LAYOUTS folder but which means everyone can access the page
<%@ Page language="C#" MasterPageFile="~/_layouts/application.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %> <asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" runat="server"> <b>Hello</b> </asp:Content>
Posted in Sharepoint | Tagged: Custom Page | Leave a Comment »
Use Session in Custom Page: Session state can only be used when enableSessionState is set to true
Posted by ken zheng on November 4, 2009
If you received this error when use session in your custom aspx page deployed to SharePoint:
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.
If you add “EnableSessionState=”true” “ to your it should enable it but also you need to modify you web.config
The problem is that by default, Sharepoint does not allow server side code in .aspx pages by default. You need to enable this using PageParserPath. Add the PageParserPath inside of the PageParserPaths node of the web.config file, changing the virtual path to the path you want to enable. Or you can use /Pages/* as the value if they are in the same folder
Posted in Sharepoint | Tagged: Custom Page, Sharepoint | Leave a Comment »
October 2009 Cumulative Update Packages for SharePoint Server 2007 and Windows SharePoint Services 3.0 is available
Posted by ken zheng on November 3, 2009
The server-packages of October 2009 Cumulative Update for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 are ready for download. October 2009 Cumulative Updates introduce more rules on Pre-Upgrade Checker, which can help customers to prepare the upgrade of their SharePoint farm to SharePoint 2010.
Download Information
Windows SharePoint Services 3.0 October 2009 cumulative update package
http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=974989
Office SharePoint Server 2007 October 2009 cumulative update package
http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=974988
Detail Description
Description of the Windows SharePoint Services 3.0 October 2009 cumulative update package
http://support.microsoft.com/kb/974989
Description of the Office SharePoint Server 2007 October 2009 cumulative update package
http://support.microsoft.com/kb/974988
Installation Recommendation for a fresh SharePoint Server
To keep all files in a SharePoint installation up-to-date, the following sequence is recommended.
1. Service Pack 2 for Windows SharePoint Services 3.0 and language packs
2. Service Pack 2 for Office SharePoint Server 2007 and language packs
3. October 2009 Cumulative Update package for Windows SharePoint Services 3.0
4. October 2009 Cumulative Update package for Office SharePoint Server 2007
Please note: Start from April 2009 Cumulative Update, the packages will no longer install on a farm without a service pack installed. You must have installed either Service Pack 1 (SP1) or SP2 prior to the installation of the cumulative updates.
After applying the preceding updates, run the SharePoint Products and Technologies Configuration Wizard or “psconfig -cmd upgrade -inplace b2b -wait” in command line. This needs to be done on every server in the farm with SharePoint installed.
The version of content databases should be 12.0.6520.5000 after successfully applying these updates.
You can also refer to April Cumulative Update post for deployment guides, slipstream how-to links and FAQs.
Posted in Sharepoint | Tagged: Sharepoint | Leave a Comment »
“The type or namespace ” does not exist in the class or namespace ” (are you missing an assembly reference?)” in SmartPart Sharepoint
Posted by ken zheng on October 29, 2009
Sometime you get this error when you deployed a web part which use references. To fix the problem, you need to open your aspx page and add references like , even you are not useing it in your UI
Posted in Sharepoint | Tagged: Sharepoint, SharePoint2007, Smart Part | Leave a Comment »
Install TFS 2010 Beta 2
Posted by ken zheng on October 27, 2009
Finally today, I managed to install TFS 2010 on my virtual pc which is server 2008 with SharePoint 2007. The erors I got is all aournd permission. So you need to make sure your SharePoint Service and Application Pool use domain account. There are 2 problems I had;
1. Ther error happens when configure the TFS.
TF255275: The following Web service for SQL Server Reporting Services could not be accessed: http:///ReportServer/ReportService2005.asmx.
To fix this error, you will need to remove the ReportServer and ReportServerTempDb database from the database server, see here for more details.
2. Grant TFS permission to SharePoint. This is a permission problem. I will need to change all my sharepopint service to run under domain account. See here
Posted in Sharepoint | Leave a Comment »
Visual Studio 2010, Fx 4 Beta 2 Training Kit
Posted by ken zheng on October 27, 2009
I believe you have notice vs 2010 beta 2 is available for download http://www.microsoft.com/australia/visualstudio/default.mspx.
There is a great set of training resources for Visual Studio 2010 & Fx 4 Beta 2 in the form of the Visual Studio 2010 and .NET Framework 4 Training Kit and check out http://channel9.msdn.com/learn/ for more great learning materials.
You’ll find material covering
1. What’s new for Common Language Runtime
2. ASP.NET 4
3. Windows
4. Windows Workflow
5. Windows Communication Foundation
6. Silverlight
7. Data Access
8. Parallel Computing
9. Extensibility Framework
10. Application Lifecycle Management
so check it out and get up to speed fast with the Visual Studio 2010 and Fx 4 Beta 2!!
Posted in vs2010 | Tagged: .Net 4, vs 2010 | Leave a Comment »