Does not contain a definition

Posted by JB on Stack Overflow See other posts from Stack Overflow or by JB
Published on 2010-04-27T21:30:57Z Indexed on 2010/04/27 21:33 UTC
Read the original article Hit count: 243

Filed under:
|

public void button2_Click(object sender, System.EventArgs e) { string text = textBox1.Text; Mainform = this;

        this.Hide();

        GetSchedule myScheduleFinder = new GetSchedule();
        string result = myScheduleFinder.GetDataFromNumber(text);// says there is no definition
        if (!string.IsNullOrEmpty(result))
        {
            MessageBox.Show(result);
        }
        else
        {
            MessageBox.Show("Enter A Valid ID Number!");
        }
    }

says it does not contain definition for it but on my GetSchedule .cs file i have it defined

public string GetDataFromNumber(string ID)//defined here {

            foreach (IDnumber IDCandidateMatch in IDnumbers)  

            { 

                if (IDCandidateMatch.ID == ID)
                {
                 StringBuilder myData = new StringBuilder();
                 myData.AppendLine(IDCandidateMatch.Name);   
                 myData.AppendLine(": ");
                 myData.AppendLine(IDCandidateMatch.ID);
                 myData.AppendLine(IDCandidateMatch.year);
                 myData.AppendLine(IDCandidateMatch.class1);
                 myData.AppendLine(IDCandidateMatch.class2);
                 myData.AppendLine(IDCandidateMatch.class3);
                 myData.AppendLine(IDCandidateMatch.class4);  
                 //return myData;
                 return myData.ToString();
    }
}
return "";

} }

}

}

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms