Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:

Recycle Bin | MMS | ManagedVsCrawledProperties |

Thursday, July 26, 2012

Migrating List which contains Lookup Fields from one Site to another Site including Data:

I have got requirement like, move/migrate the list with content from one site collection to another site collection.
Below are my approaches:
  1. Save the list as list template with include content.
  2. Download those list templates and save it into your local server.
  3. Go to “list template” gallery of another site collection and uploaded all the list templates.
  4. Create the list with based on the list templates. That’s it.
But one problem will arise here. I.e. the lookup fields are broken because lookup field referring list GUID is changed.  We can resolve it either by coding or by following below steps

Thursday, July 19, 2012

SharePoint Interview Questions and Answers: EventRecievers

  1. Event Receivers and types of event receivers?
  2. Best coding practice on event receivers?
  3. Use of DisableEventFiring() and EnableEventFiring()?
  4. BeforePropeties and AfterProperties?
  5. What all are Event receivers features introduced in SharePoint 2010?
  6. What are all new Event Receivers introduced in SharePoint 2010?
  7. Difference between event receivers and workflows?
  8. How to add an event receiver to the specific list programmatically?
  9. How to add an event receiver to the specific content type programmatically?
  10. How to add an event receiver to the content type using feature.xml file?
  11. The ItemUpdating event or the ItemUpdated event occurs two times when you enable the Require Check Out option for a document library in Windows SharePoint Services 3.0?
  12. Event Receivers with custom error page?
  13. I have one requirement, i.e. is there is one list name “Student Marks” and fields has English, Hindi, Telugu, Total, AVG. Total=English+Hindi+Telugu. The total field should be update automatically if I update any of the language marks. But here the actual problem is if you are updating two fields at a time the ItemUpdating event fires 2times. But I don’t want to fire twice. How?
  14. I have one document library and I want to allow only specific extension files (like .doc, .pdf etc.) into that document library? How can I prevent it?
  15. Why can't we use spcontext in event receivers? 
  16. Error occurred in deployment step 'Recycle IIS Application Pool': The vssphost4.exe process was unable to start due to an unknown error?  
  17.  How to delete the event receivers?
  18. How to check whether the event receiver attached or not? 
  19. I have one custom developed master page. I want to set this master page dynamically for newly created sites. what is the approach to do that?
  20. How can we handle not to allow duplicate documents in a document library?
Event Receivers:
Event Receivers has taken places either synchronously or asynchronously. If the action has taken before code execution.

All receivers that end with “ing” are synchronous and those which end with “ed” are asynchronous.

Synchronous Event Handlers will work before the event is completed while asynchronous event handlers will fire after the event is completed. 

Wednesday, July 18, 2012

Static-->variable, Method, Class, Constructor

Static Variables:
  1. A value assigned to a static variable will be shared across all instances of the class.  On the other hand an instance variable may have different values across every different instance of the class.
  2. Static variables can be mainly used for initialization purpose.

Static Methods:
  1. Static methods cannot access non-static class level members and do not have a 'this' pointer. Instance methods can access those members, but must be called through an object instantiation.
  2. Static methods can be called directly from class name.
    1. Explanation: So, need to create instance for those classes that contain static methods in it.
  3. Do not declare or override instance members in static classes.
  4. Cannot initialize instance variable or class variables in static methods.
    1. Explanation: if you declare instance variables in static methods. How can you use those variables? No chance to use of it. So not possible to create instance variables in static method.
  5. Static methods can be used to initialize the variables. But can only be initialize static variables in static methods.

Thursday, July 5, 2012

Bind lookup field data to the dropdownlist

Below code will help you to bind the lookup field data to the dropdown list.
if (spListItem["LookupField"] != null)
  SPFieldLookupValue spv = new   
  string lookupValue = spv.LookupValue;
  dropdownlist1.SelectedIndex = spv.LookupId;

 To bind field values to the dropdownlist: