New to InfoPath 2010? Try this…

4 Labs

http://www.infopathdev.com/blogs/jennifer/archive/2010/07/01/free-training-design-your-infopath-form-template-lab-1.aspx

http://www.infopathdev.com/blogs/jennifer/archive/2010/07/08/free-training-lab-2-make-your-infopath-form-template-look-and-work-better.aspx

http://www.infopathdev.com/blogs/jennifer/archive/2010/07/14/free-training-lab-3-making-it-smarter.aspx

http://www.infopathdev.com/blogs/jennifer/archive/2010/07/23/free-training-lab-4-track-responses-from-your-event-form.aspx

Also download Chaper09 code from the Professinal SharePoint 2010 Development book.

http://www.wrox.com/WileyCDA/WroxTitle/Professional-SharePoint-2010-Development.productCd-0470529423,descCd-DOWNLOAD.html

Posted in Uncategorized | Leave a comment

“The HTTP request is unauthorized with client authentication scheme ‘Anonymous’. The authentication header received from the server was ‘NTLM’.”

I spent more than 4 hours to resolve the following error.

“The HTTP request is unauthorized with client authentication scheme ‘Anonymous’. The authentication header received from the server was ‘NTLM’.”

I got this error when I tried to write a simple call “GetList(“Site Pages”) ” from List.ASMX service.

TO RESOLVE Do the following steps, after adding web reference to the service on a simple console application. using “http://[YOUR HOST HERE]/_vti_bin/lists.asmx

1.  Add the following line

ServiceReference1.ListsSoapClient list = new ServiceReference1.ListsSoapClient();

list.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;

 2. Also make sure in the app.config file you have the following.

<security mode="TransportCredentialOnly">
      <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm=""/>
      <message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
 

I hope this helps, if you have the same error.

 

 

 

Posted in Uncategorized | 2 Comments

Content Type Hub in 2010

The following links were helpful whenever I have done Content Type Hub worl.

View error logs for content type publishing

http://office.microsoft.com/en-us/sharepoint-server-help/view-error-logs-for-content-type-publishing-HA101631504.aspx

Republish all hub content types in SharePoint using PowerShell

http://get-spscripts.com/2010/11/republish-all-hub-content-types-in.html

Content Type Hub (Sharing or Syndication) SharePoint Server 2010

http://jimecox.wordpress.com/2010/11/30/content-type-hub-sharing-or-syndication-sharepoint-server-2010/

Posted in Uncategorized | Leave a comment

Extract WSP Solutions from SharePoint using PowerShell

I used this blog (http://www.sharepointbleached.com/2011/03/extract-wsp-solutions-from-sharepoint.html) to get the script.

The following simple PowerShell script will iterate through the solution store and write the WSP packages to file:
Start-Transcript “c:\wsp\transcript.txt”
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
 
$solutions = [Microsoft.SharePoint.Administration.SPFarm]::Local.Solutions;
foreach ($solution in $solutions) {
   $solution.SolutionFile.SaveAs(“c:\wsp\” + $solution.Name);
}
Stop-Transcript

 

 

 

Posted in MOSS 2007, SharePoint, SharePoint 2010, Technical Stuff | Leave a comment

The Ultimate Guide to Visual Studio 2010

Summary

I had an opportunity to attend the following MS Event at the Downers Grove IL office.

The Ultimate Guide to Visual Studio 2010 (Coding, Debugging, Modeling, Testing, Building and Deployment) By Clint Edmonson & Zain Nabouski

I would like to highlight important information and my favorite features in Visual Studio 2010 product.

VS2010 few Top Features (there are many please visit Zain’s blog)

 Setting a Breakpoint in the Call Stack Window

Moving or Selecting Between Matching Braces vstipEdit0075

Project and Item Template Creation (This one I liked the most and can be very productive for the team of developers)

SharePoint Resources for Developers

The Slide Deck for the presentation

Code Analysis

The legacy code solution and project can be put under Code Analysis tool. The tool allows viewing a high level and deep level the code complexity. I encourage every one of you to read on it and you can visit this site as a starting point.

FxCop and Style Cop

You may be aware of FxCop as a codeplex freeware tool. Now the FxCop is part of Visual Studio. For the SharePoint Developers I encourage you to download the SharePoint FxCop Rule

The Style cop is for the beautifying the code. Basically to enforce the standard coding style guide lines for the enterprise and project. The Style cop can be found here.

UML Related features

Now Visual Studio 2010 supports the latest UML 2.x version. The existing projects (or legacy code) can be reversed engineered to generate the UML blue prints. My favorite feature is to generate the Architectures layer diagram (this is MS version not UML). The layer diagram restricts developers to write code which may be talks to higher layer. In other words the UI layer can be restricted so the code can no call the data layer. These layer diagrams and its dependency can be customized as needed. Please check out the few screenshot here

Posted in Technical Stuff | Leave a comment

Unknown SPRequest error occurred. More information: 0x80020009

I got the following exception when I add the custom web part.

Unable to add selected web part(s).

WPIndexingOutcomeSummary: Exception occured. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)

There is very little information MOSS 2007 leaves for such exception. (The SharePoint 2010 is better in this space). But anyhow I had logs/blogs and reading I was able to narrow down the error using this blog.

 By reading the blog I did not get any information what is the cause and resolution. Specially read the comments lines by Mark Strokes. Also best practices is http://msdn.microsoft.com/en-us/library/aa973248(office.12).aspx

 Mark Stokes – Sept. 23, 2008

I also had this issue and in my case, it was because my web part was accidentally putting a using statement around SPWeb web = SPContext.Current.Web

Bad Bad.  Correcting this sorted the problem.

CAUSE

To add any web part in the MOSS 2007 site on the XXXX Client Site Def sites it threw the following exception. In the ULS logs the following was the information thrown for any web part(s) (Custom or OOB). The key error message is highlighted in yellow.

01/28/2011 08:21:32.23              w3wp.exe (0x1350)                                       0x0C24       Windows SharePoint Services                          General                                          8e2s                        Medium    Unknown SPRequest error occurred. More information: 0x80020009      

01/28/2011 08:21:32.52              w3wp.exe (0x1350)                                       0x0C24       Windows SharePoint Services                          Web Parts                                      89ku                        High           

Failed to add webpart http%253A%252F%252Fwin%252Dc0mtbrojocq%253A22222%252Fsites%252FDemo%252F%255Fcatalogs%252Fwp%252FMSContentEditor%252Edwp;Content%2520Editor%2520Web%2520Part. 

Exception Microsoft.SharePoint.WebPartPages.WebPartPageUserException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))    

at Microsoft.SharePoint.WebPartPages.SPWebPartManager.SaveSomeChanges(SPLayoutProperties layoutProperties)    

at Microsoft.SharePoint.WebPartPages.WebPart.SaveSomeChanges(SPLayoutProperties layoutProperties)    

at Microsoft.SharePoint.WebPartPages.SPWebPartManager.WPSaveSomeChanges(SPLayoutProperties layoutProperties)    

at Microsoft.SharePoint.WebPartPages.SPWebPartManager.MakeSpaceForWebPart(WebPart webPartToPlace, Int32 zoneIndex, String zoneID, Boolean storeInPendingChangesList)    

at Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnWebPartAddingCore(SPSupersetWebPart superset, Boolean throwIfLocked)    

at Microsoft.SharePoint.WebPartPages.SPWebPartManager.AddWebPartInternal(SPSupersetWebPart superset, Boolean throwIfLocked)    

at Microsoft.SharePoint.WebPartPages.SPWebPartManager.AddWebPartInternal(SPSupersetWebPart superset)    

at Microsoft.SharePoint.WebPartPages.WebPartQuickAdd.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)

RESOLUTION

In the code there were three files used the line within using statement.

“using (SPWeb web = SPContext.Current.Web)”

The three files are:

  C:\DMS\DMS\Source Code\UI\Web\WebForms\IndexingPage.aspx.cs(26):                    //using (SPWeb web = SPContext.Current.Web)

  C:\DMS\DMS\Source Code\UI\Web\WebForms\ViewIndexingProperties.aspx.cs(162):            //using (SPWeb web = SPContext.Current.Web)

  C:\DMS\DMS\Source Code\UI\Web\Webparts\CAEL.DMS.UI.Webparts\Administration.cs(35):                //using (SPWeb web = SPContext.Current.Web)

I commented the using keyword and recompiled the code and deployed to VM I was able to add the web part.

So in summary:

  1. The SPContext.Current.Web should NEVER be within using statement. By putting in the using statement it is automatically destroyd and it should never be destroyed.
  2. Since the above “SPContext.Current.Web” was used in the using statement at later time when I tried to add the web part I got the exception “     Unknown SPRequest error occurred. More information: 0x80020009” in the ULS log.
  3. By commenting the using statement and accesing the variable “SPContext.Current.Web” as is correct fix.

I hope if you get similar error and this information helps you.

Thanks,

-Pankaj Surti

Posted in MOSS 2007, SharePoint, Technical Stuff | 1 Comment

Orphanded Site objectes in MOSS 2007

At the client side I was asked to create a site using their legacy code. The code failed to create a new site and gave an error the “site already exists”. In the CA I was able to see the site in Site Collection List. However, I could not delete the site. The site had some orphaned objects.

Other diagnosis is, when I ran the following command

stsadm -o enumsites http://demo

I noticed in the output the good site listed correctly but the bad or corrupted site had an exception (as seen below).

  <Site Url=”http://demo/sites/VM” Owner=”EDLINK\psf” ContentDatabase=”WSS_CLIENTS” StorageUsedMB=”35034.6″ StorageWarningMB=”0″ StorageMaxMB=”0″ />
  <Site Error=”The system cannot find the path specified. (Exception from HRESULT: 0x80070003)” />
</Sites>

Did some search for above error/exception and noticed it is something to do with the Orphaned Site objects.

To resolve the problem, I had to attach and detach the content database. The details steps are following. I hope this helps resolving your problem.

— Check for no orphans… Note: you may or may not see the orphaned objects. I always noticed zero count for the problem.

STSADM -o preparetomove -ContentDB DEMO-SQL1:WSS_CLIENTS -site http://demo
— Prepare to move
— Look http://technet.microsoft.com/en-us/library/cc262122(v=office.12).aspx
STSADM -o preparetomove -ContentDB DEMO-SQL1:WSS_CLIENTS -site http://demo

— Dettach the content database
stsadm -o deletecontentdb -url http://demo -databasename WSS_CLIENTS -databaseserver DEMO-SQL1

— Attach content DB
stsadm -o addcontentdb -url http://demo -databasename WSS_CLIENTS -databaseserver DEMO-SQL1


— check for no orphans, if it was present before hopefully the count will be zero this time.
stsadm -o databaserepair -url http://demo -databasename WSS_CLIENTS


— UNDO Prepare to move
— Look http://technet.microsoft.com/en-us/library/cc262122(v=office.12).aspx
STSADM -o preparetomove -ContentDB DEMO-SQL1:WSS_CLIENTS -site http://demo -undo

Thanks,

-Pankaj Surti.

Posted in MOSS 2007, SharePoint, Technical Stuff | Leave a comment

Cricket 2011 Schedule


Day


Date


Country
Vs


Country


Venue


GMT


CST

Winner (Win-Loss)


Sa

Feb. 19

Bangladesh

India

Dhaka

(0830)

(0230)

India  (1-0)

Bangladesh (0-1)


Su

Feb. 20

New Zealand

Kenya

Chennai

(0400)

(2200)

New Zealand(1-0)

Kenya (0-1)


Su

Feb. 20

Sri Lanka

Canada


Hambantota

(0900)

(0300)

Sri Lanka (1-0)

Canada (0-1)


Mo

Feb. 21

Australia

Zimbabwe

Ahmedabad

(0900)

(0300)

Australia(1-0)


Tu

Feb. 22

England

Netherlands

Nagpur

(0900)

(0300)

England (1-0)


We

Feb. 23

Pakistan

Kenya


Hambantota

(0900)

(0300)

Pakistan (1-0)


Th

Feb. 24

South Africa

West Indies

New Delhi

(0900)

(0300)

South Africa (1-0)


Fr

Feb. 25

Australia

New Zealand

Nagpur

(0400)

(2200) – 1

Australia (2-0)


Fr

Feb. 25

Bangladesh

Ireland

Dhaka

(0830)

(0230)

Bangladesh (1-1)


Sa

Feb. 26

Sri Lanka

Pakistan

Colombo

(0900)

(0300)

Pakistan (2-0)


Su

Feb. 27

India

England

Bangalore

(0900)

(0300)

Tied @ 338


Mo

Feb. 28

Zimbabwe

Canada

Nagpur

(0400)

(2200) – 1

 Zimbabwe (1-1)


Mo

Feb. 28

West Indies

Netherlands

New Delhi

(0900)

(0300)

 


Tu

Mar-01

Sri Lanka

Kenya

Colombo

(0900)

(0300)

 


We

Mar-02

England

Ireland

Bangalore

(0900)

(0300)

 


Th

Mar-03

South Africa

Netherlands

Mohali

(0400)

(2200) – 1

 


Th

Mar-03

Pakistan

Canada

Colombo

(0900)

(0300)

 


Fr

Mar-04

New Zealand

Zimbabwe

Ahmedabad

(0400)

(2200) – 1

 


Fr

Mar-04

Bangladesh

West Indies

Dhaka

(0830)

(0230)

 


Sa

Mar-05

Sri Lanka

Australia

Colombo

(0900)

(0300)

 


Su

Mar-06

England

South Africa

Chennai

(0400)

(2200) – 1

 


Su

Mar-06

India

Ireland

Bangalore

(0900)

(0300)

 


Mo

Mar-07

Kenya

Canada

New Delhi

(0900)

(0300)

 


Tu

Mar-08

Pakistan

New Zealand

Kandy

(0900)

(0300)

 


We

Mar-09

India

Netherlands

New Delhi

(0900)

(0300)

 


Th

Mar-10

Sri Lanka

Zimbabwe

Kandy

(0900)

(0300)

 


Fr

Mar-11

West Indies

Ireland

Mohali

(0400)

(2200) – 1

 


Fr

Mar-11

Bangladesh

England

Chittagong

(0830)

(0230)

 


Sa

Mar-12

India

South Africa

Nagpur

(0900)

(0300)

 


Su

Mar-13

New Zealand

Canada

Mumbai

(0400)

(2200) – 1

 


Su

Mar-13

Australia

Kenya

Bangalore

(0900)

(0300)

 


Mo

Mar-14

Bangladesh

Netherlands

Chittagong

(0330)

(2130) – 1

 


Mo

Mar-14

Pakistan

Zimbabwe

Kandy

(0900)

(0300)

 


Tu

Mar-15

South Africa

Ireland

Kolkata

(0900)

(0300)

 


We

Mar-16

Australia

Canada

Bangalore

(0900)

(0300)

 


Th

Mar-17

England

West Indies

Chennai

(0900)

(0300)

 


Fr

Mar- 18

Ireland

Netherlands

Kolkata

(0400)

(2200) – 1

 


Fr

Mar- 18

Sri Lanka

New Zealand

Mumbai

(0900)

(0300)

 


Sa

Mar-19

Bangladesh

South Africa

Dhaka

(0330)

(2130) – 1

 


Sa

Mar-19

Australia

Pakistan

Colombo

(0900)

(0300)

 


Su

Mar-20

Zimbabwe

Kenya

Kolkata

(0400)

(2200) – 1

 


Su

Mar-20

India

West Indies

Chennai

(0900)

(0300)

 


We

Mar-23

Quarter-final

Quarter-final

Dhaka

(0830)

(0230)

 


Th

Mar-24

Quarter-final

Quarter-final

Ahmedabad

(0900)

(0300)

 


Fr

Mar-25

Quarter-final

Quarter-final

Dhaka

(0830)

(0230)

 


Sa

Mar-26

Quarter-final

Quarter-final

Colombo

(0900)

(0300)

 


Tu

Mar-29

Semi-final

Semi-final

Colombo

(0900)

(0300)

 


We

Mar-30

Semi-final

Semi-final

Mohali

(0900)

(0300)

 


Sa

Apr-02

Final

Final

Mumbai

(0900)

(0300)

 
Posted in Cricket | Leave a comment

Web Objects in XML aka WOX

http://woxserializer.sourceforge.net/index.html

I first found about the WOX from MSDN article. It is cool that these platform has a way to come to common ground. Good for us developers.

Posted in Technical Stuff | Leave a comment

Face book API

Today and last week as well, in my project I had to go through the FaceBook API. The API is located here. http://developers.facebook.com/docs/reference/api/user

The API is very straight forward call to the REST service. For testing, you will need to get the token by loging in to FaceBook with your account. The token can be then used to make a REST service call.

I found the following C# API library very useful.
https://github.com/facebook/csharp-sdk

I hope this is useful.

Posted in Facebook Developers Info | Leave a comment