Tuesday, February 11, 2014

Fix “SPUpdatedConcurrencyException” error in SharePoint 2013

Original:  http://www.pbnet.ro/?p=372


Fix the “SPUpdatedConcurrencyException” that appears in the upgrade logs when running PSCONFIG

Posted by pbnet on Wednesday, February 6, 2013 · Leave a Comment
Scenario: You installed upgrade binaries on your  SharePoint 2010 farm and you run the following command to upgrade the farm: psconfig –cmd upgrade –inplace b2b –wait –force. Afterwards, the upgrade fails and you get the following error in the upgrade logs:
Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException was thrown. Additional exception information: An update conflict has occurred, and you must re-try this action.

Solution:
1. run: stsadm -o setproperty -pn command-line-upgrade-running -pv no
2.  perform an IISReset
3. Restart the SharePoint 2010 Timer (OWSTIMER)
4. run the command again: psconfig –cmd upgrade –inplace b2b –wait –force
NOTE: make sure that the other web server is stopped.

Thursday, April 4, 2013

Allow BDC connect to SQL Server

When setting the Authentication mode of the External system properties in the Connection to BDC Identity, the following command shell below needs to be executed in the App Server.




$bdc = Get-SPServiceApplication where {$_ -match "BDC Service App"};

$bdc.RevertToSelfAllowed = $true;

$bdc.Update();



NOTE: Make sure that the application pool identity running on the SharePoint web server has the right privileges in the SQL Server data source.

Wednesday, November 30, 2011

Avoid computed fields in your index

I have a stored procedure that deletes records from different table. It perfectly working fine until I added an index to the table. What makes this issue confusing is I'm not able to replicate it in a different environment. So, let's start with the error that I got before I get side-track with my frustrations :)

DELETE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.

I found this MSDN article (http://msdn.microsoft.com/en-us/library/ms190356.aspx) and the last bullet is leading me into something:

When you are creating and manipulating indexes on computed columns or indexed views, the SET options ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER, ANSI_NULLS, ANSI_PADDING, and ANSI_WARNINGS must be set to ON. The option NUMERIC_ROUNDABORT must be set to OFF.

If any one of these options is not set to the required values, INSERT, UPDATE, DELETE, DBCC CHECKDB and DBCC CHECKTABLE actions on indexed views or tables with indexes on computed columns will fail. SQL Server will raise an error listing all the options that are incorrectly set. Also, SQL Server will process SELECT statements on these tables or indexed views as if the indexes on computed columns or on the views do not exist.


It seems like the bullet above translates to this set of commands to address the issue:

SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF


The script above might work, but I’m not so sure if that is really what I wanted to do.... This approach will surely require some code modification and that would be a maintenance nightmare long-term.

So, I looked at the other angle of the problem. I checked if part of my index had included a computed column. VIOLA! I found one!

Removing those stink'n fields from my indexes resolved the issue.

Wednesday, April 13, 2011

My SharePoint Development Environment

I have researched on what would be the best way for me to setup a development environment for SharePoint - instead I ended up asking myself a question. Well, I guess the question is how much development I will be doing in SharePoint. Ohhhhhh Kkkkkk.... Hmmmm.

Well, let's just assume that I am a SharePoint developer. I do .NET programming for a living and I code a lot. But, SharePoint development isn't no longer just programming. Nowadays, a couple of clicks in SharePoint 2010 can deliver a web site that is dynamic enough that users can interact with each other using forms, discussion boards, etc.

I think there is a balance between a developer and admin work when working with SharePoint development. It's no longer just developer, developer, developer (sounds familiar?). SharePoint development will usually require a lot of configuration. Configurations are usually hard to backup.

So, here's my thought on SharePoint Development environment. I think virtualizing my SharePoint Development environment is a way to go.

From what I heard and read, virtualization has a lot of advantages however it takes resources such disk space, processor power and memory from my machine. Virtualization is also expensive for this kind of purpose - some may say it's overkill for a developer workstation. Nevertheless, here are the advantages of having a virtual SharePoint Dev Environment:

1. Easy to backup SharePoint server's configuration.
2. Can work multiple instances of SharePoint projects that has different stages of feature development
3. Quick and easy way to introduce a consistent development environment to the new developer.
4. I got a clean host machine - I won't be worried of any patch update from our HelpDesk team :).
5. One reason to get a faster machine ;)

Tuesday, February 15, 2011

Tips on deploying Silverlight and RIA on the server

http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx

Tuesday, January 11, 2011

How-to copy calendar item in SharePoint

ClientContext client = new ClientContext(http://myweb/mysite/calendar);
var web = client.Web;

List listD = web.Lists.GetByTitle("Destination_Calendar");
client.Load(listD);
client.ExecuteQuery();

//clear destination list
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = "";
ListItemCollection listDItems = listD.GetItems(camlQuery);
client.Load(listDItems);
client.ExecuteQuery();

//remove list items from the destination
foreach (ListItem li in listDItems.ToList())
{
li.DeleteObject();
client.ExecuteQuery();
}


//get source items
List list = web.Lists.GetByTitle("Source_Calendar");
client.Load(list);
client.ExecuteQuery();
camlQuery = new CamlQuery();
camlQuery.ViewXml = @"";
ListItemCollection listItems = list.GetItems(camlQuery);
client.Load(listItems);
client.ExecuteQuery();

ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();


//add list item to the destination list
foreach (ListItem listItem in listItems)
{

ListItem newItem = listD.AddItem(itemCreateInfo);
newItem["Title"] = listItem["Title"];
newItem["Description"] = listItem["Description"];
newItem["EventDate"] = listItem["EventDate"];
newItem["EndDate"] = listItem["EndDate"];
newItem["Category"] = listItem["Category"];
newItem["ParticipantsPicker"] = listItem["ParticipantsPicker"];
newItem["RecurrenceData"] = listItem["RecurrenceData"];
newItem["fRecurrence"] = listItem["fRecurrence"];
newItem["EventType"] = listItem["EventType"];
newItem["XMLTZone"] = listItem["XMLTZone"];
newItem["UID"] = System.Guid.NewGuid();

newItem.Update();
client.ExecuteQuery();

}

Wednesday, December 8, 2010

Rendering SSRS Reports - Manually

Here is an article that talks about accessing report server web service that is running on top of SharePoint.

CLICK HERE TO VIEW DIRECTLY TO MICROSOFT SITE: http://msdn.microsoft.com/en-us/library/ms155398.aspx

OTHERWISE, YOU CAN READ THE SAME ARTICLE I COPIED JUST IN CASE:


MSDN Library Servers and Enterprise Development SQL Server SQL Server 2008 R2 Product Documentation SQL Server 2008 R2 Books Online Reporting Services Development Developer's Guide Report Server Web Service Report Server Web Service Methods Report Server Web Service Endpoints Community ContentThere are three ReportService20X...> There are two endpoints ava...More...

Report Server Web Service Endpoints
SQL Server 2008 R2 Other Versions SQL Server "Denali" SQL Server 2008 SQL Server 2005

The Report Server Web service provides several endpoints for managing a report server as well as executing and navigating reports.

The Management Endpoints
--------------------------------------------------------------------------------

There are two endpoints available for managing objects on a report server, ReportService2005, ReportService2006, and ReportService2010. The ReportService2005 endpoint is used for managing objects on a report server that is configured for native mode. The ReportService2006 endpoint is used for managing objects on a report server that is configured for SharePoint integrated mode. The ReportService2010 endpoint merges the functionalities of ReportService2005 and ReportService2006 and can manage objects on a report server that that are configured for either native or SharePoint integrated mode.

Important
When a report server is configured for SharePoint integrated mode, the ReportService2005 APIs will return an rsOperationNotSupportedSharePointMode error. If the report server is configured for native mode, the ReportService2006 APIs will return an rsOperationNotSupportedNativeMode error. Similarly, when mode-specific APIs in ReportService2010 are used on unintended modes, the APIs will return the respective errors.


Note
The ReportService2005 and ReportService2006 endpoints are deprecated in SQL Server 2008 R2. The ReportService2010 endpoint includes the functionalities of both endpoints and contains additional management features.


If the report server is configured for native mode or SharePoint integrate mode, the WSDL for the management endpoint can be accessed using one of the following URL:

Copy http:///ReportServer/ReportService2010.asmx?wsdl
For more information, see Accessing the SOAP API.

The Execution Endpoint
--------------------------------------------------------------------------------

The ReportExecution2005 endpoint makes it easy for developers to customize report processing and rendering from a report server in both native and SharePoint integrated modes. The endpoint includes classes and methods that existed in earlier versions of the Report Server Web service. In addition, many new classes and methods have been added to the Report Server Web service that are exposed through the execution endpoint.

The WSDL for the management endpoint can be accessed using the following URL:

Copy http:///ReportServer/ReportExecution2005.asmx?wsdl
If the report server is configured for SharePoint integrate mode, the WSDL can be accessed using the following URL:

Copy http:////_vti_bin/ReportServer/ReportExecution2005.asmx?wsdl
For more information, please see Accessing the SOAP API.

SharePoint Proxy Endpoints
--------------------------------------------------------------------------------

When a report server is configured for SharePoint integrated mode and the Reporting Services Add-in has been installed, a set of proxy endpoints are installed on the SharePoint server. The proxy endpoints are the primary API for developing report solutions when a report server is configured for SharePoint integrated mode. When developing against the proxy endpoints, the Reporting Services Add-in manages the exchange of credentials between the SharePoint server and the report server in Trusted account authentication mode. When developing against the report server endpoints, the calling application will have to manage the credential exchange in Trusted account authentication mode. The following table lists the endpoints that are installed with the Reporting Services Add-in.

Proxy Endpoint
Description

ReportService2006
Provides the APIs for managing a report server that is configured for SharePoint integrate mode.

NoteThis endpoint is deprecated in SQL Server 2008 R2.
ReportService2010
Provides the APIs for managing a report server that is configured for either native or SharePoint integrated mode.

ReportExecution2005
Provides the APIs for running and navigating reports.

ReportServiceAuthentication
Provides the APIs for authenticating users against a report server when the SharePoint Web application is configured for Forms Authentication.


The following are example URLs for referencing the proxy endpoints on a SharePoint site.

Copy http:////_vti_bin/ReportServer/ReportService2010.asmx
Copy http:////_vti_bin/ReportServer/ReportExecution2005.asmx
Copy http:////_vti_bin/ReportServer/ReportServiceAuthentication.asmx
See Also
--------------------------------------------------------------------------------

Other Resources
Building Applications Using the Web Service and the .NET Framework
Community Content Add FAQ There are three ReportService20XX endpoints available.
> There are two endpoints available for managing objects on a report server, ReportService2005, ReportService2006, and ReportService2010. $0As you could see, there are three endpoints available.$0
History


11/9/2010
vasilep
© 2010 Microsoft Corporation. All rights reserved.Terms of Use Trademarks Privacy Statement Feedback Feedbackx Tell us about your experience... Did the page load quickly? Yes No Do you like the page design? Yes No How useful is this topic? Tell us more Enter description here.






BUT WAIT, here is a better article that actually solves my problem when rendering an SSRS report - regardless of how it was deployed... whether it's SharePoint Integrated Mode or Native Mode... this works pretty well.

CLICK HERE TO VIEW DIRECTLY TO MICROSOFT SITE: http://msdn.microsoft.com/en-us/library/ms152835.aspx

OTHERWISE, YOU CAN READ THE SAME ARTICLE I COPIED JUST IN CASE:

MSDN Library Servers and Enterprise Development SQL Server SQL Server 2008 R2 Product Documentation SQL Server 2008 R2 Books Online Reporting Services Development Developer's Guide URL Access Using URL Access Parameters Community ContentAdd code samples and tips to enhance this topic.More...

Using URL Access Parameters
SQL Server 2008 R2 Other Versions SQL Server "Denali" SQL Server 2008 SQL Server 2005

You can use the following parameters as part of a URL to configure the look and feel of your reports. The most common parameters are listed in this section. Parameters are case-insensitive and begin with the parameter prefix rs: if directed to the report server and rc: if directed to an HTML Viewer. You can also specify parameters that are specific to devices or rendering extensions. For more information about device-specific parameters, see Specifying Device Information Settings in a URL.

HTML Viewer Commands
--------------------------------------------------------------------------------

The following table describes the URL access parameters that are prefixed with rc: and are used to target the HTML Viewer.

Parameter
Action

Toolbar
Shows or hides the toolbar. If the value of this parameter is false, all remaining options are ignored. If you omit this parameter, the toolbar is automatically displayed for rendering formats that support it. The default of this parameter is true.

Parameters
Shows or hides the parameters area of the toolbar. If you set this parameter to true, the parameters area of the toolbar is displayed. If you set this parameter to false, the parameters area is not displayed and cannot be displayed by the user. If you set this parameter to a value of Collapsed, the parameters area will not be displayed, but can be toggled by the end user. The default value of this parameter is true.

Zoom
Sets the report zoom value as an integer percentage or a string constant. Standard string values include Page Width and Whole Page. This parameter is ignored by versions of Internet Explorer earlier than Internet Explorer 5.0 and all non-Microsoft browsers. The default value of this parameter is 100.

Section
Sets which page in the report to display. Any value that is greater than the number of pages in the report displays the last page. Any value that is less than 0 displays page 1 of the report. The default value of this parameter is 1.

StartFind
Specifies the last section to search. The default value of this parameter is the last page of the report.

EndFind
Sets the number of the last page to use in the search. For example, a value of 5 indicates that the last page to be searched is page 5 of the report. The default value is the number of the current page. Use this parameter in conjunction with the StartFind parameter.

FallbackPage
Sets the number of the page to display if a search or a document map selection fails. The default value is the number of the current page.

GetImage
Gets a particular icon for the HTML Viewer user interface.

Icon
Gets the icon of a particular rendering extension.

Stylesheet
Specifies a style sheet to be applied to the HTML Viewer.


You can pass additional parameters on a URL to direct the output for HTML rendering. For more information, see HTML Device Information Settings.

Report Server Commands
--------------------------------------------------------------------------------

The following table describes the URL access parameters that are prefixed with rs: and are used to target the report server.

Parameter
Action

Command
Specifies the last section to search. The default value of this parameter is the last page of the report.

Format
Specifies the format in which to render a report. Common values include HTML3.2, HTML4.0, MHTML, IMAGE, EXCEL, WORD, CSV, PDF, XML, and NULL. For more information, see Specifying a Rendering Format in a URL.

ParameterLanguage
Provides a language for parameters passed in a URL that is independent of the browser language. The default value is the browser language. The value can be a culture value, such as en-us or de-de.

Snapshot
Renders a report based on a report history snapshot. For more information, see Rendering Report History Snapshots Using URL Access.

PersistStream
Renders a report in a single persisted stream. This parameter is used by the Image renderer to transmit the rendered report one chunk at a time. After using this parameter in a URL access string, use the same URL access string with the GetNextStream parameter instead of the PersistStream parameter to get the next chunk in the persisted stream. This URL command will eventually return a 0-byte stream to indicate the end of the persisted stream. The default value is false.

GetNextStream
Gets the next data chunk in a persisted stream that is accessed using the PersistStream parameter. For more information, see the description for PersistStream. The default value is false.


Report Viewer Web Part Commands
--------------------------------------------------------------------------------

The following table describes the SQL Server reserved report parameter names that are used to target the Report Viewer Web Part when Reporting Services is integrated with Windows SharePoint Services (WSS) 3.0 or later, as well as Microsoft Office SharePoint Server 2007 or later. These parameter names are prefixed with rv:. The Report Viewer Web Part also accepts the rs:ParameterLanguage parameter.

Parameter
Action

Toolbar
Controls the toolbar display for the Report Viewer Web Part. The default value is Full. Values can be:

Full : display the complete toolbar.

Navigation : display only pagination in the toolbar.

None : do not display the toolbar.

HeaderArea
Controls the header display for the Report Viewer Web Part. The default value is Full. Values can be:

Full : display the complete header.

BreadCrumbsOnly : display only the bread-crumb navigation in the header to inform the user where they are in the application.

None : do not display the header.

DocMapAreaWidth
Controls the display width, in pixels, of the parameter area in the Report Viewer Web Part. The default value is the same as the Report Viewer Web Part default. The value must be a non-negative integer.

AsyncRender
Controls whether a report is rendered asynchronously. The default value is true, which specifies that a report be rendered asynchronously. The value must be a Boolean value of true or false.


Examples
--------------------------------------------------------------------------------

The following example hides the HTML Viewer toolbar by setting the rc:Toolbar parameter value to false:

Copy http:///reportserver?/Sales/YearlySalesSummary&rs:Command=Render&rs:Format=HTML4.0&rc:Toolbar=false
The following example passes a hard-coded parameter and hides the input field for user-supplied parameters:

Copy http:///reportserver?/Sales/YearlySalesSummary&rs:Command=Render&rs:Format=HTML4.0&rc:Parameters=false&Year=2002
The following example uses the rc:Zoom parameter to set the zoom property of the report to Page Width:

Copy http:///reportserver?/Sales/YearlySalesSummary&rs:Command=Render&rs:Format=HTML4.0&rc:Zoom=Page Width
The following example toggles section 13 of the report:

Copy http:///reportserver?/Sales/YearlySalesSummary&rs:Command=Render&rs:ShowHideToggle=13
See Also
--------------------------------------------------------------------------------

Reference
Using Parameter Prefixes in a URL
Other Resources
URL Access
Community Content Add FAQ © 2010 Microsoft Corporation. All rights reserved.Terms of Use Trademarks Privacy Statement Feedback Feedbackx Tell us about your experience... Did the page load quickly? Yes No Do you like the page design? Yes No How useful is this topic? Tell us more Enter description here.