Cannot convert from Link to RelatedLink !!

Discussion in '.NET' started by avecreep, Aug 6, 2008.

  1. avecreep

    avecreep

    Joined:
    Aug 5, 2008
    Messages:
    2
    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.RelatedWorkItemId);
    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..
     
    avecreep, Aug 6, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    906
    Kevin Spencer
    May 17, 2005
  2. Graham Thomson
    Replies:
    3
    Views:
    491
    Eki Y. Baskoro
    Dec 18, 2003
  3. Dan M
    Replies:
    5
    Views:
    446
    wittempj@hotmail.com
    Jun 10, 2006
  4. kolesdz
    Replies:
    9
    Views:
    556
    Blinky the Shark
    Aug 22, 2007
  5. Marina Limeira

    LINK with another link

    Marina Limeira, Feb 7, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    136
    Marina Limeira
    Feb 7, 2006
Loading...

Share This Page