Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Cannot convert from Link to RelatedLink !! (http://www.velocityreviews.com/forums/t629452-cannot-convert-from-link-to-relatedlink.html)

avecreep 08-06-2008 01:20 PM

Cannot convert from Link to RelatedLink !!
 
Hi,

i have the following lines of code:

foreach (Link link in workItem.Links)

{

RelatedLink relatedLink = link as RelatedLink;
if (relatedLink != null)

{

WorkItem relatedWorkItem = workItem.Store.GetWorkItem(relatedLink.RelatedWork ItemId);
txtTaskHistory.Text = relatedWorkItem.Id.ToString();

}

else

MessageBox.Show("there is a mistake");

}

When i debug, i see that link is not null, but relatedLink becomes null after the line
RelatedLink relatedLink=link as RelatedLink and displays error message.
Can anyone tell me what is wrong with it?

Thank you..


All times are GMT. The time now is 11:49 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.