Posts

Showing posts from October, 2013

Could not load file or assembly ‘Microsoft.Sharepoint.Sandbox, Version=14.0.0.0

Image
Could not load file or assembly ‘Microsoft.Sharepoint.Sandbox, Version=14.0.0.0, ………….. Posted: June 25, 2013 in SharePoint 2010 , Technical Diary Tags: 'Microsoft.Sharepoint.Sandbox , Could not load file or assembly , DLL Erro , SharePoint2010 , Version=14.0.0.0 0 Assembly error in ASP.Net Web Application during Run Time   “Could not load file or assembly ‘Microsoft.Sharepoint.Sandbox, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” Issue I created an ASP.Net Web Application. I added a reference to the “Microsoft.SharePoint.dll”. I needed this to use some of the SharePoint Server Object Model assemblies.   The application was built successfully, however at runtime it threw the following error – On investigating I found that a “Microsoft.Sharepoint.Sandbox.dll” was created in the bin folder of my Web application.  An instinctiv...

Hide left navigation using javascript in sharepoint 2010

This Style Script will hide the left navigation in SharePoint site. 1. Add Content Editor web part in SharePoint site page. 2. Add below script to content editor web part. <style> #s4-leftpanel {                 DISPLAY: none } .s4-ca {                 MARGIN-LEFT: 0px }</style>

Get data from Sql Stored Procedure to grid view control using c#

1. Create stored procedure in sql server with select query (with or with out input parameters). 2. Create windows application or web application in VS 2010. private void btnGetData_Click( object sender, EventArgs e)         {             dataGridView1.DataSource = GetData();                    } public static SqlConnection NewConnection()         {             string ConnectionString = @"server=*****; uid=***; pwd=****;                  database=*****;" ;             return new SqlConnection (ConnectionString);      ...

Copy Users and Groups using SharePoint 2010 Power-shell script

In this case i am maintaining values as ";" seperated values in this script. If we want to maintain data please use list items. It is best approach for workflows also. http://SP2010:8080/Powershellaction.asmx  by using this SharePoint 2010 service we able to find the "RunScript" method for power-shell script. save this script as "TestScript.ps1" and run this file in SharePoint power-shell cmd prompt.  >&"c:\TestScript.ps1" TestScript.ps1: web = Get-SPWeb "http://SP2010:8080/sites/12345Test2" for ($i = $web.RoleAssignments.Count -1; $i -ge 0; $i--) {      $web.RoleAssignments.Remove($i)  }   if($web.SiteGroups["Engineers"] -eq $null)  {           $web.SiteGroups.Add("Engineers", $web.Site.Owner, $web.Site.Owner, "Use this group to grant people Contribute permissions to the $web site") } $EngineersGroup = $web.SiteGroups["Engineers"] $EngineersGro...