Knowledge Base Article

Home Page > Knowledge Base > Rapise

Home Page > Knowledge Base > Spira Platform

Home Page > Knowledge Base > Spira Platform > SpiraTeam

Home Page > Knowledge Base > Spira Platform > SpiraTest

Article Fixing 'Unable to cast object of type 'System.DBNull' to type 'System.String'' errors in Spira v4.x

by Adam S on Monday, June 15, 2015

Sometimes when you are saving Rapise test scripts into some early versions of Spira v4.2.x.x (e.g. Spira v4.2.0.1 - v4.2.0.5) you can start getting these errors on the Test Case details page. You may also get the error for other reasons in earlier versions of Spira v4.x.

The cause of the issue is that the Document folders in the project have gotten messed-up, with multiple folders being listed as a 'root-folder' which is not allowed. So if you receive this error on the Test Case Details page:

Unable to cast object of type 'System.DBNull' to type 'System.String'.

Then the first thing to do is to run:

SELECT * FROM TST_PROJECT_ATTACHMENT_FOLDER WHERE PROJECT_ID = X

(where X is the ID of the project).

If you see multiple entries in the results with PARENT_PROJECT_ATTACHMENT_FOLDER_ID  set to NULL then that is the cause of the issue. In which case, you need to set the PARENT_PROJECT_ATTACHMENT_FOLDER_ID for the second result to the real root project ID.

For example, if you have the following:

PROJECT_ATTACHMENT_FOLDER_IDPROJECT_IDPARENT_PROJECT_ATTACHMENT_FOLDER_IDNAME
11NULLRoot Folder
211Specifications
311Screen Captures
411Test Results
514Error Messages
614Web Links
711Design Documents
811Misc Documents
1211Test Scripts
1411CreateNewAuthor
151NULLCreateNewBook
1611EditExistingAuthor
1711EditExistingBook

Then you'd run the following:

UPDATE TST_PROJECT_ATTACHMENT_FOLDER
SET PARENT_PROJECT_ATTACHMENT_FOLDER_ID = 1
WHERE PROJECT_ATTACHMENT_FOLDER_ID = 15

and that would fix the issue.

If you are hosted by Inflectra, then just mention this article in the ticket along with the error message and the ID of the affected project, and a member of our support team will fix it for you.

Attachments
Article Info
Last Updated: 6/15/2015
Article ID: KB159
# Views: 645
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.