The backup file should be restored to a server with version ‘’ or later.

Leave a comment

Go to Central Administration –> Application Management –> Manage content databases —> see the name of database.
Now go to Powershell and type this command
Upgrade-SPContentDatabase WSS_Content

In the place of WSS_Content write your content db name.Once its executes.You can restore backup

Using list service to display data in sharepoint site page

Leave a comment

Situation: Need to display a set of data in sharepoint list based on a dropdown in the page. For that if we plan to write a visualwebpart. But while changing the values in the dropdown Postbacks will occur which will be not smooth.

To handle this is in a simple way we can use 1) Ajax 2) List service.

Here I will explain with List service.

1) Create a Sharepoint list “EmployeeList”

2) The list service will be accessed as: http://abc:123/_vti_bin/ListData.svc/EmployeeList (This is an example)

3)Now we need to create a new page in Sitepages.

4) In that new page insert a Content Editor  Web Part (CEWP)

5) Now Open a Notepad and write your Jquery code and save it as Employee.JS and give a reference in the new page created.

Point to remember: You must place the js reference link only in between the PlaceHolderAdditionalPageHead. nOT ONLY .JS  we can refer .css files also in PlaceHolderAdditionalPageHead.

<asp:Content ContentPlaceHolderId=”PlaceHolderAdditionalPageHead” runat=”server”>

<script type=”text/javascript” src=”/SitePages/employee.js”></script>


6) After referencing write a code in employee.js to retrieve all the list data and show them or render it in a tabular form

7) employee.js

$(document).ready(function() {

var url=” http://abc:123/_vti_bin/ListData.svc/EmployeeList ” ;

$.getJSON(url,function(data) {
var count = 0;
html= “<table>”;
$.each(data.d.results, function(i,result) {
var title = result.Title;
var emp=result.Employee;
var empid=result.EMPID;




//dont need headers again here



count = count +1;




8) now we need a content editor webpart to render our html output. here we given according to jquery with a div

<div id=”Result” style=”font-size: 10px; color: blue”></div>

9)take a text file and copy above html code and link that with content editor webpart

10) Then in browser it will render all table data

Suppose if you want filter data with some specific value you must give list service url as like this:

http://abc:123/_vti_bin/ListData.svc/EmployeeList?$filter=EMPID eq ‘1234’ ”


The type or namespace name ‘DataContract’ could not be found (are you missing a using directive or an assembly reference?

Leave a comment

just add:

add System.Runtime.Serialization in references

limit the iterations in foreach loop c#

Leave a comment

Hi All,

Sometimes there will be a huge data to loop through but you need to check for few iterations only say 10. In that case items collections in foreach loop contains a built in method to limit the iterations.TAKE

foreach (Object o in collection.Items.Take(10))






Returns a specified number of contiguous elements from the start of a sequence. (Defined by Enumerable.)

Five fascinating revelations from ‘Becoming Steve Jobs’

Leave a comment


Get current logged user in list event receivers?

Leave a comment

SPUser user = properties.Web.CurrentUser;

Sort Datatable values in Ascending Order

Leave a comment

NameSpace:  System.Data

We need to use DataView.Sort Property

Let us consider you already have a Datatable dt with some content in it and you want sort it in ascending order by the column Rollno


DataView dvt=new Dataview(dt);

dvt.sort=”RollNno ASC”;

//then again assign that view to datatable dt.



Older Entries


Get every new post delivered to your Inbox.

Join 313 other followers

%d bloggers like this: