Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Archive for July, 2012

SharePoint 2010–HOw to create context dynamically?

Posted by Paul on July 31, 2012

using (SPSite site = new SPSite("http://localhost"))

            {

var context = SPContext.GetContext(site.OpenWeb());

 

            }

 

// Occassionally through a console/winform application we need to create SharePoint context.

// Above code performs the same

Advertisements

Posted in SharePoint | Tagged: | Leave a Comment »

SharePoint 2010–HOw to create context dynamically?

Posted by Paul on July 31, 2012

using (SPSite site = new SPSite("http://localhost"))

            {

var context = SPContext.GetContext(site.OpenWeb());

 

            }

 

// Occassionally through a console/winform application we need to create SharePoint context.

// Above code performs the same

Posted in SharePoint | Tagged: | Leave a Comment »

SharePoint 2010 – Business Connectivity Services (BCS)

Posted by Paul on July 31, 2012

In this article we can explore another feature of SharePoint 2010 – Business Connectivity Services. This service allows data reading and writing from external data sources.

Using BCS we can access and modify data from:

· WCF Service

· Database

· Business Applications

· .Net Assembly connecting to Business Data

· Custom Connectors

BCS Architecture

The BDC Runtime is responsible for connecting to the external data sources. External data sources connections are stored in BCS Metadata inside SharePoint. The BCS Metadata allows connecting to the data sources in offline mode too. SharePoint acts as a Presentation layer in this scenario.

clip_image002

Note

The previous version of BCS was BDC (Business Data Catalog)

Following are the components of BCS.

BDC Metadata Store

This component provides storage for metadata consisting of external data sources and content types and it will be part of the BCS layer.

BDC Server Runtime

This runtime component is responsible for connecting to the BDC Metadata Store and processing the requests.

BDC Client Runtime

Client runtime providing offline storage, synchronizing data back to server etc.

SharePoint Designer

We can use SharePoint Designer provided tools for creating BCS Solutions.

References

http://msdn.microsoft.com/en-us/magazine/ee819133.aspx

http://msdn.microsoft.com/en-us/library/ie/ee557898.aspx

Summary

In this article we have explored the BCS feature of SharePoint 2010. In the next article we can experiment with creating a BCS external content type inside SharePoint.

Posted in SQL Server | Tagged: | Leave a Comment »

SharePoint 2010 – Business Connectivity Services (BCS)

Posted by Paul on July 31, 2012

In this article we can explore another feature of SharePoint 2010 – Business Connectivity Services. This service allows data reading and writing from external data sources.

Using BCS we can access and modify data from:

· WCF Service

· Database

· Business Applications

· .Net Assembly connecting to Business Data

· Custom Connectors

BCS Architecture

The BDC Runtime is responsible for connecting to the external data sources. External data sources connections are stored in BCS Metadata inside SharePoint. The BCS Metadata allows connecting to the data sources in offline mode too. SharePoint acts as a Presentation layer in this scenario.

clip_image002

Note

The previous version of BCS was BDC (Business Data Catalog)

Following are the components of BCS.

BDC Metadata Store

This component provides storage for metadata consisting of external data sources and content types and it will be part of the BCS layer.

BDC Server Runtime

This runtime component is responsible for connecting to the BDC Metadata Store and processing the requests.

BDC Client Runtime

Client runtime providing offline storage, synchronizing data back to server etc.

SharePoint Designer

We can use SharePoint Designer provided tools for creating BCS Solutions.

References

http://msdn.microsoft.com/en-us/magazine/ee819133.aspx

http://msdn.microsoft.com/en-us/library/ie/ee557898.aspx

Summary

In this article we have explored the BCS feature of SharePoint 2010. In the next article we can experiment with creating a BCS external content type inside SharePoint.

Posted in SQL Server | Tagged: | Leave a Comment »

Strange Error on new UserProfileManager()

Posted by Paul on July 30, 2012

Today I was receiving a strange error on creating instance of UserProfileManager()

eg: UserProfileManager obj = new UserProfileManager();

Error

Object reference not set to an instance..

Root Cause

Although the error message was not self explanatory on the web i could see the root cause was that the user who executed the application not in the Permissions list of User Profile Service Application.

Fix

Open Central Admin > Manage Service Applications > User Profile Service Application (select) > Permissions > Add current logged in user (user who executes the program)

image

Add and Assign Full Control  to the user

image

Note: It did not worked for me as i was having cross-forest issues may be.

Actual Fix

Following was my fix which worked: (STSADM Command through PowerShell)

STSADM –o updatefarmcredentials –userlogin DOMAIN\USER –password YOURPASSWORD

This command should be executed in the Central Administration hosting server.

More Info: http://technet.microsoft.com/en-us/library/cc262150(v=office.12).aspx

Posted in SharePoint | Tagged: | Leave a Comment »

User Profile Service Error & Solution

Posted by Paul on July 27, 2012

I had following error setting up User Profile Service and accessing through Server Object Model.

I thought of sharing the solution as this could help others:

Error with FIMSynchronizationService : (viewed from Windows Event Viewer – eventvwr.exe)

The server encountered an unexpected error and stopped.

"ERR: MMS(2504): libutils.cpp(10513): RegQueryValueEx of Server failed with 2

BAIL: MMS(2504): libutils.cpp(10515): 0x80070002 (The system cannot find the file specified.)

ERR: MMS(2504): libutils.cpp(10513): RegQueryValueEx of SQLInstance failed with 2

BAIL: MMS(2504): libutils.cpp(10515): 0x80070002 (The system cannot find the file specified.)

ERR: MMS(2504): libutils.cpp(10513): RegQueryValueEx of DBName failed with 2

BAIL: MMS(2504): libutils.cpp(10515): 0x80070002 (The system cannot find the file specified.)

BAIL: MMS(2504): server.cpp(359): 0x80070002 (The system cannot find the file specified.)

BAIL: MMS(2504): server.cpp(3860): 0x80070002 (The system cannot find the file specified.)

BAIL: MMS(2504): service.cpp(1539): 0x80070002 (The system cannot find the file specified.)

ERR: MMS(2504): service.cpp(988): Error creating com objects. Error code: –2147024894. This is retry number 0.

BAIL: MMS(2504): clrhost.cpp(224): 0x80131022

BAIL: MMS(2504): scriptmanagerimpl.cpp(7670): 0x80131022

BAIL: MMS(2504): server.cpp(251): 0x80131022

BAIL: MMS(2504): server.cpp(3860): 0x80131022

BAIL: MMS(2504): service.cpp(1539): 0x80131022

ERR: MMS(2504): service.cpp(988): Error creating com objects. Error code: –2146234334. This is retry number 1.

BAIL: MMS(2504): clrhost.cpp(224): 0x80131022

BAIL: MMS(2504): scriptmanagerimpl.cpp(7670): 0x80131022

BAIL: MMS(2504): server.cpp(251): 0x80131022

BAIL: MMS(2504): server.cpp(3860): 0x80131022

BAIL: MMS(2504): service.cpp(1539): 0x80131022

ERR: MMS(2504): service.cpp(988): Error creating com objects. Error code: –2146234334. This is retry number 2.

BAIL: MMS(2504): clrhost.cpp(224): 0x80131022

BAIL: MMS(2504): scriptmanagerimpl.cpp(7670): 0x80131022

BAIL: MMS(2504): server.cpp(251): 0x80131022

BAIL: MMS(2504): server.cpp(3860): 0x80131022

BAIL: MMS(2504): service.cpp(1539): 0x80131022

ERR: MMS(2504): service.cpp(988): Error creating com objects. Error code: –2146234334. This is retry number 3.

BAIL: MMS(2504): service.cpp(1002): 0x80131022

Forefront Identity Manager 4.0.2450.47"

Solution

I did the following solution: Hotfix for Microsoft SharePoint Server 2010

Description of the SharePoint Server 2010 cumulative update package (SharePoint server-package): April 24, 2012

Ensure

Please ensure that the following too:

1. Following Windows Services are running:

a. Forefront Identity Manager Service

b. Forefront Identity Manager Synchronization Service

2. Following SharePoint Services are running: (inside Central Administration > Manage services on server)

a. User Profile Service

b. User Profile Synchronization Service

3. Add spadmin to Local machine Administrators group ( server manager > users > groups > open administrators group > add spadmin)

Posted in SharePoint | Tagged: | Leave a Comment »

Search Alerts

Posted by Paul on July 24, 2012

In this article we can examine the Search Alerts feature of SharePoint.

What is Search Alert?

Search Alert is a feature by which the user query is saved. Later when a content matches the query, the user is informed about the content through email or RSS feed. The major search providers online have this feature.

SharePoint 2010 also provides the Search Alert feature.

Experimenting with Alert

You can try with the Search Alert feature.

1. Open the default site and use the search term which does not exist. For eg: Art of Living. Clearly your search result will be none as shown below.

clip_image002

2. Now click on the Email button which is highlighted above. You will get the following screen

clip_image004

Enter the details and click the OK button. Your Search Alert is ready.

For testing the alert, create a list content with the Alert Keyword. You will be getting email notification for the same as daily summary / weekly summary based on the option you have selected. We can also add RSS feeds as an alternative for Email.

References

http://www.bainsight.com/blog-archive/Pages/5-12-2011.aspx

Summary

In this article we have explored the Search Alerts feature of SharePoint.

Posted in SharePoint | Tagged: , , , | Leave a Comment »

Foster Sign Off

Posted by Paul on July 11, 2012

I hope all of my great friends are doing good.. I would like to declare the Sign Off of Foster!

The further activities allowed are support & bug fixes 🙂

image

image

What is the next project?

I have more requirements pending from the community to create a project for Leave Approval System, Document Management etc.  I believe now there is only requirement of articles in this case.  The project Foster should be enough to gain a grip over the SDLC activities involved in a SharePoint project plus conceptualizing & implementing.

Thank You All for supporting & encouraging me for Foster!

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

SharePoint 2010 Project – Foster (Consolidated Article)

Posted by Paul on July 11, 2012

In this article I would like to consolidate the information about project named Foster.

What is Foster?

Foster represents Food Stamps Terminal, a department in imaginary company which provides Food Stamps for applicants. The applicant has to undergo a process of approval to get the Food Stamps.  Our aim is to build a SharePoint solution for it.

image

What are the Files involved?

This project was build using the SDLC principles.

You can find the consolidated Article with Documents & Source code at c-sharpcorner.com (my article base):

FOSTER @ C-SHARPCORNER.COM

You can download the source here.

You can also purchase the book from Kindle at Amazon.

FOSTER

I would advise the reader to go through the above order of documents. I request you to understand the requirements and conceptualize the solution yourself. You can use forums / web resources to come with the best solution.

Thinking in the SharePoint Way

I know that you are well versed in providing solutions in the ASP.NET way. But the same solution can be done in SharePoint with more than 50% reduced time. To achieve this you have to practice on the SharePoint skills. To focus more on SharePoint skills development I have discarded the complex business portions from the project.

Purpose of the Project

The purpose of the project is to give the reader a real time scenario for applying SharePoint 2010 knowledge. There is a good amount of SharePoint 2010 skills involving:

· Architecting

· Development

· Administration

Who can benefit from this?

I target the developers who recently adapted SharePoint skills. This project definitely gives them an opportunity to think in the SharePoint way in solving problems. Plus doing the project yourself will make you build enormous amount of troubleshooting and debugging skills.

What are the skills gained after doing the Project?

Following are the skills gained through this project: (I prefer you learn my eBook first before attempting the project)

1. Web Application

2. Site Collection & Sub Sites

3. Users & Permissions

4. List Definitions, Instances, Views

5. Custom Content Type & List Definition

6. Navigation Links & Quick Launch

7. WebParts

8. SPQuery, CAML & Builder Tool

9. Visual Studio Workflow

10. Server Object Model

11. Client Object Model

12. Search using CAML Query

13. Custom Timer Job & Monitoring

14. Packaging & Deployment

Plus the developer will gain the following experience as well:

  • Windows 2008 Installation
  • Active Directory Configuration
  • SharePoint 2010 Server Installation
  • DNS Configuration
  • SDLC Approach to Projects

Acknowledgements

I would like to thank the community and my friends who supported in creating this project and the associated documents.

Source

Please find the source code here.

Feedback

As always there is opportunity to improve, I would like to get your feedback or queries in the design and solution. Together we can improve ourselves and make better products for tomorrow.

Any Helps.. Please contact me through Comments / Email (About screen have Email Address)

I believe helping others keeps us improvised & satisfying!

image

Posted in C#, SharePoint | Tagged: , , , | 27 Comments »

SharePoint 2010 Project – Foster (Consolidated Article)

Posted by Paul on July 11, 2012

In this article I would like to consolidate the information about project named Foster.

What is Foster?

Foster represents Food Stamps Terminal, a department in imaginary company which provides Food Stamps for applicants. The applicant has to undergo a process of approval to get the Food Stamps.  Our aim is to build a SharePoint solution for it.

image

What are the Files involved?

This project was build using the SDLC principles.

You can find the consolidated Article with Documents & Source code at c-sharpcorner.com (my article base):

FOSTER @ C-SHARPCORNER.COM

You can also purchase the book from Kindle at Amazon.

FOSTER

I would advise the reader to go through the above order of documents. I request you to understand the requirements and conceptualize the solution yourself. You can use forums / web resources to come with the best solution.

Thinking in the SharePoint Way

I know that you are well versed in providing solutions in the ASP.NET way. But the same solution can be done in SharePoint with more than 50% reduced time. To achieve this you have to practice on the SharePoint skills. To focus more on SharePoint skills development I have discarded the complex business portions from the project.

Purpose of the Project

The purpose of the project is to give the reader a real time scenario for applying SharePoint 2010 knowledge. There is a good amount of SharePoint 2010 skills involving:

· Architecting

· Development

· Administration

Who can benefit from this?

I target the developers who recently adapted SharePoint skills. This project definitely gives them an opportunity to think in the SharePoint way in solving problems. Plus doing the project yourself will make you build enormous amount of troubleshooting and debugging skills.

What are the skills gained after doing the Project?

Following are the skills gained through this project: (I prefer you learn my eBook first before attempting the project)

1. Web Application

2. Site Collection & Sub Sites

3. Users & Permissions

4. List Definitions, Instances, Views

5. Custom Content Type & List Definition

6. Navigation Links & Quick Launch

7. WebParts

8. SPQuery, CAML & Builder Tool

9. Visual Studio Workflow

10. Server Object Model

11. Client Object Model

12. Search using CAML Query

13. Custom Timer Job & Monitoring

14. Packaging & Deployment

Plus the developer will gain the following experience as well:

  • Windows 2008 Installation
  • Active Directory Configuration
  • SharePoint 2010 Server Installation
  • DNS Configuration
  • SDLC Approach to Projects

Acknowledgements

I would like to thank the community and my friends who supported in creating this project and the associated documents.

Feedback

As always there is opportunity to improve, I would like to get your feedback or queries in the design and solution. Together we can improve ourselves and make better products for tomorrow.

Any Helps.. Please contact me through Comments / Email (About screen have Email Address)

I believe helping others keeps us improvised & satisfying!

image

Posted in C#, SharePoint | Tagged: , , , | 23 Comments »