Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cannot convert from Link to RelatedLink !!

Reply
Thread Tools

Cannot convert from Link to RelatedLink !!

 
 
avecreep avecreep is offline
Junior Member
Join Date: Aug 2008
Posts: 2
 
      08-06-2008
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..
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To convert to J2SE 6 or not to convert, that is the question... Jaap Java 4 07-10-2006 09:03 AM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
convert list of strings to set of regexes; convert list of strings to trie Klaus Neuner Python 7 07-26-2004 07:25 AM
Do I need to Convert with Convert.ToInt32(session("myNumber")) ? Andreas Klemt ASP .Net 1 07-23-2003 02:59 PM



Advertisments