This project is read-only.

"Conversion failed when converting the nvarchar value '{itemId}' to data type int" error

Nov 3, 2008 at 9:42 PM
Edited Nov 3, 2008 at 9:44 PM
I've just installed October's version. Everything seems to go well except for the "Podcasts" web part on the main page (pkshomepage.aspx), which returns this message:
"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator"

A look at the Event Viewer reveals this (category: Publishing, Event ID: 7352):

"Error occured while processing a Content Query Web Part. Performing the following query '<ViewFields><FieldRef Name='PodcastThumbnail' Type=' URL'/><FieldRef Name='PodcastAuthor' Type=' User'/><FieldRef Name='Description' Type=' Note'/><FieldRef Name='PodcastDuration' Type=' Text'/><FieldRef Name='Downloads' Type=' Number'/><FieldRef Name='Format' Type=' Choice'/><FieldRef Name='PodcastLanguage' Type=' Choice'/><FieldRef Name='PodcastPublishDate' Type=' DateTime'/><FieldRef Name='Rating' Type=' Number'/><FieldRef Name='Tags' Type=' Text'/><FieldRef Name='FileURL' Type=' Text'/><FieldRef Name='PodcastSize' Type=' Text'/><FieldRef Name='PodcastSizeInBytes' Type=' Number'/><FieldRef Name='PodcastDurationInSeconds' Type=' Number'/><FieldRef Name='Title' Type=' Text'/><FieldRef Name='RssFileUrl' Type=' Text'/><FieldRef Name='PodcastThumbnail' Type=' URL'/><FieldRef Name='PodcastAuthor' Type=' User'/><FieldRef Name='Description' Type=' Note'/><FieldRef Name='PodcastDuration' Type=' Text'/><FieldRef Name='Downloads' Type=' Number'/><FieldRef Name='Format' Type=' Choice'/><FieldRef Name='PodcastLanguage' Type=' Choice'/><FieldRef Name='PodcastPublishDate' Type=' DateTime'/><FieldRef Name='Rating' Type=' Number'/><FieldRef Name='Tags' Type=' Text'/><FieldRef Name='FileURL' Type=' Text'/><FieldRef Name='PodcastSize' Type=' Text'/><FieldRef Name='PodcastSizeInBytes' Type=' Number'/><FieldRef Name='PodcastDurationInSeconds' Type=' Number'/><FieldRef Name='Title' Type=' Text'/><FieldRef Name='RssFileUrl' Type=' Text'/><FieldRef Name='PodcastThumbnail' Type=' URL'/><FieldRef Name='PodcastAuthor' Type=' User'/><FieldRef Name='Description' Type=' Note'/><FieldRef Name='PodcastDuration' Type=' Text'/><FieldRef Name='Downloads' Type=' Number'/><FieldRef Name='Format' Type=' Choice'/><FieldRef Name='PodcastLanguage' Type=' Choice'/><FieldRef Name='PodcastPublishDate' Type=' DateTime'/><FieldRef Name='Rating' Type=' Number'/><FieldRef Name='Tags' Type=' Text'/><FieldRef Name='FileURL' Type=' Text'/><FieldRef Name='PodcastSize' Type=' Text'/><FieldRef Name='PodcastSizeInBytes' Type=' Number'/><FieldRef Name='PodcastDurationInSeconds' Type=' Number'/><FieldRef Name='Title' Type=' Text'/><FieldRef Name='RssFileUrl' Type=' Text'/><FieldRef Name='PodcastThumbnail' Type=' URL'/><FieldRef Name='PodcastAuthor' Type=' User'/><FieldRef Name='Description' Type=' Note'/><FieldRef Name='PodcastDuration' Type=' Text'/><FieldRef Name='Downloads' Type=' Number'/><FieldRef Name='Format' Type=' Choice'/><FieldRef Name='PodcastLanguage' Type=' Choice'/><FieldRef Name='PodcastPublishDate' Type=' DateTime'/><FieldRef Name='Rating' Type=' Number'/><FieldRef Name='Tags' Type=' Text'/><FieldRef Name='FileURL' Type=' Text'/><FieldRef Name='PodcastSize' Type=' Text'/><FieldRef Name='PodcastSizeInBytes' Type=' Number'/><FieldRef Name='PodcastDurationInSeconds' Type=' Number'/><FieldRef Name='Title' Type=' Text'/><FieldRef Name='RssFileUrl' Type=' Text'/><FieldRef Name='CsId' Type=' Text'/><FieldRef Name='TargetedAudience' Type=' Choice'/><FieldRef Name='TargetedAudienceLevel' Type=' Choice'/><FieldRef Name='PodcastFiles' Type=' Note'/><FieldRef Name='Confidentiality' Type=' Choice'/><FieldRef Name="ScopeId" /><FieldRef Name="_Level" /><FieldRef Name="UniqueId" /><ListProperty Name="DraftVersionVisibility" /></ViewFields><Lists ServerTemplate="10003"></Lists><Webs Scope="Recursive" /><RowLimit>3</RowLimit><Query><Where><And><Contains><FieldRef Name="CsId"/><Value Type="Text">{csId}</Value></Contains><Eq><FieldRef Name="ID"/><Value Type="Text">{itemId}</Value></Eq></And></Where></Query>' generated the following error: Conversion failed when converting the nvarchar value '{itemId}' to data type int. at the following url: /sites/Multimedia. Web Part title: Podcasts"

Along with this error right before it (Category: Office Server General; Event ID: 7888):

"

A runtime exception was detected. Details follow.
Message: Conversion failed when converting the nvarchar value '{itemId}' to data type int.

Techinal Details:
System.Data.SqlClient.SqlException: Conversion failed when converting the nvarchar value '{itemId}' to data type int.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.HasMoreRows()
   at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout)
   at System.Data.SqlClient.SqlDataReader.Read()
   at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean& bSucceed)
   at Microsoft.SharePoint.Library.SPRequestInternalClass.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns)
   at Microsoft.SharePoint.Library.SPRequest.CrossListQuery(String bstrUrl, String bstrXmlWebs, String bstrXmlLists, String bstrXmlQuery, ISP2DSafeArrayWriter pCallback, Object& pvarColumns)
   at Microsoft.SharePoint.SPWeb.GetSiteData(SPSiteDataQuery query)
   at Microsoft.SharePoint.Publishing.CachedArea.GetCrossListQuery(SPSiteDataQuery query, SPWeb currentContext)
   at Microsoft.SharePoint.Publishing.CrossListQueryCache.GetSiteData(CachedArea cachedArea, SPWeb web, SPSiteDataQuery query)

"
Nov 5, 2008 at 9:57 PM

Hi Tourpe,

Can you verify a couple of things:

- Verify the page you are receiving the error on, it appears as though it's the PodcastDetail page and send the exact URL (you can edit server name if needed)
 
- Also does the publishing error occur every time or intermittently? 

- Is this an upgrade or clean install, if an upgrade did you manually delete the pages prior to upgrade.

Thanks,
-a

Nov 6, 2008 at 10:44 PM
Thanks for your quick answer.

1) About the location where the problem occurs
The problem I indicated occurs on the the home page. In my case: http://[my sharepoint server]/sites/Multimedia/Pages/pkshomepage.aspx
But true enough, I have pretty much the same issue on http://[my sharepoint server]/sites/Multimedia/Pages/podcastdetail.aspx
It displays:

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator.

and they, right underneath:
QueryString of key "csId" not found

2) The problem happens all the time. I can't get it to work

3) It's an upgrade from September release. I did delete all the pages as per the instructions.

Anything else I should check?

Herve

Nov 6, 2008 at 11:03 PM
I wonder if my problem has to do with the fact that I've installed PKS under a new site collection /sites/multimedia. The CQWP seem to look for MainXslLink = "/Style Library/XSL Style Sheets/PKSMain.xsl" (same problem with ItemXslLink), but my file PKSMain.XSL islocated at /sites/Multimedia/Style Library/XSL Style Sheets/PKSMain.xsl.


Does it mean we can only instal PKS at the root of a server?

Herve
Nov 7, 2008 at 5:18 PM

For testing purposes try making a copy of the Style Library and re-creating a new Style Library on your multimedia site.

Nov 8, 2008 at 9:48 PM
I found the issue. I used ssm.exe install PKSFull.xml http://[my web server] instead of  ssm.exe install PKSFull.xml http://[my web server]/site/multimedia. In general, the installation documentation is very misleading for people who use a site collection (i.e. probably the majority). Most of the documentation refer to "/pages..." when it should be "[site collection path]/pages/...

I have deleted my site colelction and started again from scratch. I have other problems but I will post them in a separate thread.
Nov 11, 2008 at 8:50 AM
Herve

Thank you for your comment against my thread and it appears we have a similar problem with creating PKS installation as a sub-site.  I found this link that throws up a lot of what you are looking at above.  There appear to be hundreds of links that need to be changed in order for it all to run smoothly and perhaps would benefit more from a direct root install if this is possible.  I did try this earlier last week but the isue I had was that it landed on my Welcome page to our Learning Gateway solution (I work at a College/School) and clearly this is not the best place for it. 

If the link does not provide you with the appropriate page (I noticed this morning that it was down)  I have a copy of the data that was on the site that could be posted for you if you are interested.

It does seem like a huge effort to install as a sub=site though.

Chris
Nov 11, 2008 at 5:54 PM
Thanks Chris. The link you provided is a great resource (the guy even used the same path as I do /sites/multimedia). I'm hesitatnt to simply use his code though, as he was using the August release. So I'll go ahead ang go through his instructions, and will report back here.

I have to admit that it seems more and more like I'd be better off building an new SharePoint site and putting pks on the root...

Hey, sheer up, I have the proof PKS CAN work! These guys have PKS running here. It's on the root...

Herve
Nov 11, 2008 at 8:46 PM
Herve

It's no surprise they got it working as they were part of the primary development team for PKS.

I do not have that luxury of being able to recreate at the root as it has to form part of our Learning Gateway (School Virtual Learning Environment) solution and so has to be a sub-site.

I used the code simply lifted the style library files out and replaced them with his and they work a treat.  I have a few issues still with metadata not populating and the cursed csid query string showing on the podcastdetail page that nobody seems to have an answer for.  Maybe one day!!  I think I have tried about 10 times now since July

Good luck with yours anyway.

Chris
Nov 11, 2008 at 10:52 PM
Edited Nov 11, 2008 at 10:55 PM
I'm about to give up. Actually I'm giving up for now. Even if I manage to make it work in a site collection, I don't want to go through that everyt time there's an update. Unless the good people who maintain the code do something about it, that is...
 
Anyone who is interested in fixing this issue should vote here.
Nov 12, 2008 at 11:05 PM
 

Hi Tourpe,

 

Sorry to hear about your problems installing to a sub-site. PKS does work in sub sites but some manual updates are required that cannot be automatically performed during the install.

 

As you identified the order to install to a sub site is:

-> Point the SSM installer to the root of the site collection where PKS will be installed http://server/sites/subsite

-> Updated each page with the CBQ web part and update the location of the XSL - In order the update the XSL paths in the CBQ web part rather than making via shared properties. The web part needs be exported, next open the exported web part via notepad and update the paths to point to the correct site location. 

 

The updates that need to be made are:

 <property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/PKSItem.xsl</property> <property name="MainXslLink" type="string">/Style Library/XSL Style Sheets/PKSMain.xsl</property>

 

Unfortunately this is know issue with the CBQ web part, and we are working towards a solution to allow these changes to be made via shared properties that would allow upgrades to be performed more easily.

 

Thanks,

-a