Posts

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...

Export data from SharePoint Silverlight application to Excel using REST API

This demo will show how to export data from SharePoint Silverlight application to Excel template or excel sheet. Steps: 1.        Create REST API application using MVC4 architecture (URL based navigation). 2.        Integrate URL directly in Silverlight hyperlink control in XAML. Step: Create one MVC4 application using visual studio 2010 frame work. Create one ExportController.cs class file under   Controller   folder in mvc4 project. This class will work as a API application between SharePoint Silverlight and REST API. Create one more ExportRepository.cs file under DataLayer folder. Add one more folder to the solution name as GenerateExcel folder add class file in this folder. File name is ExportToExcel.cs ExportController.cs [ HttpGet ]         [ ActionName ( "SharedDocuments" )]         public HttpResponseMessage Sha...