Skip to main content

Posts

Error Adding a Content Database to a Web Application Programatically in Sharepoint

To add a content database to Web App. I am using admin account that has full access to SP 2010 and Sql 2008 R2 with all needed rights. It throws the following exception while debugging the code. "Could not connect to SqlServer\instanace with user domain\user: Cannot connect to database master at SQL server at SqlServer\instance. The database might not exist, or the current user does not have permission to connect to it." Solution: Create and Delete the Web Applications and Site collections Programmitically in Sharepoint To create and delete a web application and associated site collection programmatically. Deleting was achieved using the following code: SPServiceCollection services = SPFarm.Local.Services; foreach   (SPService curService in services) {     if (curService is SPWebService)     {         SPWebService webSer...

Sharepoint 2010 Code Samples

Sharepoint 2010 Code Samples from Microsoft SharePoint 2010: Leveraging HTML5 Objects in SharePoint SharePoint 2010: Creating Document Sets Programmatically SharePoint 2010: Programmatically Finding Tagged Items SharePoint 2010: Developing AJAX-Enabled Web Parts SharePoint 2010: Using JavaScript to Enable Notifications SharePoint 2010: Creating Taxonomies Programmatically SharePoint 2010: Developing List Definitions SharePoint 2010: Managing Document Sets Programmatically SharePoint 2010: Using JavaScript and CAML to Query Lists SharePoint 2010: Developing JQuery-Enabled Web Parts SharePoint 2010: Creating Content Types Programmatically SharePoint 2010: Using JavaScript to Create Lists SharePoint 2010: Developing Styled Master Pages SharePoint 2010: Developing Delegate Controls SharePoint 2010: Performing Cross-List Queries SharePoint 2010: Using JavaScript to Edit and Save Values in Items   SharePoint 2010: Using JavaScript to Get Detai...

Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 on computer ‘servername’.

Error while deploying your Project/Application: Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 on computer ‘servername’. Solution: By default SharePoint Services UserCode Host Services is disabled. Just you need to enable it. Below are the steps to fix the error : Step 1. Start “ SPUserCodeV4 ″ service on the server. Start “ Server Manager ” on windows server 2008. Go to Server manager> Configuration >Services . Start “ SharePoint 2010 User Code Host ”      (SPUserCodeV4)  service if it is not running. After solve this issue you will get one more error(maybe) Error occurred in deployment step ‘Activate Features’: This feature cannot be activated at this time. The contents of the feature’s solution requires the Solution Sandbox service to be running. Step 2: Start “ Microsoft SharePoint Foundation Sandboxed Code Service ” from Sharepoint 2010 Central Administration. Go to Central A...

Visual Studio 2012 Download

Visual Studio 2012RC Compatibility When upgrading from Microsoft Visual Studio 2010 to the next release of Visual Studio you will take advantage of a refreshed and simplified environment with enhanced performance without any additional hardware requirements. Some of these core enhancements make use of capabilities that are only present in the latest versions of Windows and might require you to upgrade to a supported operating system. For product-specific, minimum system requirements. System Requirements The system requirements for most of the products in the next release of Visual Studio are:   Hardware Requirements  •1 GB of RAM (1.5 GB if running on a virtual machine)  •10 GB (NTFS) of available hard disk space  •5400 RPM hard drive  •DirectX 9-capable video card running at 1024 x 768 or higher display resolution    •1.6 GHz or faster processor   Supported Architectures •32-bit (x86) •64-bit (...

Code blocks are not allowed in this file in Sharepoint 2010

The SharePoint is based on ASP.Net Application, so all possible ASP.Net errors may easily become apparent in a SharePoint application. The ‘ Code blocks are not allowed in this file ‘ issue isn’t an exception. To get rid of it we need to enable server side scripts by modifying the web.config file. Specifically we need to locate <PageParserPaths> within web.config and add a proper <PageParserPath> node to it. The following example demonstrates how to allow server side scripts for all pages , which contain the apps virtual folder in their relative paths: <PageParserPaths>      <PageParserPath VirtualPath="/apps/*" CompilationMode="Always"              AllowServerSideScript="true" IncludeSubFolders="true" />  </PageParserPaths> After the modification, server side scripts will work for such pages as e.g. http://myServer/apps/default.aspx http://mySe...

How to Configure the ReportViewer in Sharepoint 2010

Follow The below Steps... 1. Navigate the c:\inetpub\wwwroot\VirtualDirectories\[Your port Number] 2. Make a backup copy of web.config 3. Open web.config in some text editor , may be notepad     Look for following tag , ensure enableSessionState="true"     <pages asynctimeout="7" enablesessionstate="true" enableviewstate="true" enableviewstatemac="true"        pageparserfiltertype="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" validaterequest="false">  4. Look for <httpmodules> tag and add below statement as last child node ( if not there already ) <add name="Session" type="System.Web.SessionState.SessionStateModule"> 5. Look for this tag below and update version to 10.0.0.0  <add name="ReportViewerWebControl" verb="*" path="Rese...

JavaScript for Date and Time Formatting

JavaScript for Date and Time Formatting //function for the getting the formatted date and time  // current output June 26, 2012 4:04 PM function formattedUTCDateTime(d) {     // code for the year     var m_names = new Array("January", "February", "March",     "April", "May", "June", "July", "August", "September",     "October", "November", "December"); //    var d = new Date();     var curr_date = d.getUTCDate();     var sup = ""; else if ( curr_date  == 3 ||  curr_date  == 23) {          sup  = "rd";     }     if ( curr_date == 1 || curr_date == 21 || curr_date == 31) {         sup = "st";     }     else if ( curr_date == 2 || curr_date == 22) {         sup = "nd";     }         else {         sup = ...

Repeating Sections with People Picker in Infopath 2010

An InfoPtah 2010 form consist of a repeating section, In this section Three  People/Group picker controls exists. Evenry time I open this form in the web, I cannot seem to validate/resolve the users. A Script error is shows: Message: 'EntityEditor_UseContentEditableControl' is undefined. Apparently  this has someting to do with the fact that the controls are hidden by default. I am not sure but my collegue is using repeating tables and does not have the same errors, so perhaps  Resolve the issue. For me I just had to open the first section by default so that on loading the form, all the controls are visible. Go to: File->Form Options -> Advanced ->Edit Default Values check the box in front of the repeating section that holds the people picker.

Sharepoint 2010 Interview Questions

 Pennywise Solutions 1. what is masterpage ? use of materpage..? 2.  what is meant by sitetemplate ? how can u create a site template? 3. Wat is meant by work flow ? how can u create a workflow on lists and libraries 4. Wat is meant by webpart ? how can u deploy the webpart ? h’w many ways we deploy the webpart 5. did u use any contenteditor webpart in ur project..? 6. Wat is meant by features, uses of features ? did u create any features in ur project..? 7. did u create any event handlers ? on which events u rised those event handlers…? 8. Wat is sharepoint solution file..? 9. did u write any BDC in ur project..? 10. did u configure enterprise search crawl settings ? how ? 11. what is sharepoint object model ..? 12. diff betwen intranetsite extranet site and internet sites 13.  h’w can u create a cutsomtemplates..? 14. what is the use of infopath forms…? did u use any datasource in infopath forms..? 15. what...