Does not contain a definition
- by JB
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 "";
}
}
}
}