There’s an error: “The type being set is not compatible with the value representation of the tag.”
string fi = null;
public void reading(object sender, EventArgs e)
{
read_from_folder = folderBrowserDialog1.ShowDialog();
if (read_from_folder == DialogResult.OK)
{
files_in_folder = Directory.GetFiles(folderBrowserDialog1.SelectedPath);
foreach (string fi files_in_folder)
{
string fi_nam = filese_in_folder.ToString();
...
}
}
}
private void button1_Click(object sender, EventArgs e)
{
DicomDirectory cop = new DicomDirectory(fi);
cop.Load(fi);
}
I agree with Frederik, the local
fihides the class-level member. But it isn’t clear what you expect to be in that variable in the button click handler.Because you’re looping, if you use the class member
fi, you’ll only have the last file referenced. This probably doesn’t make sense. If you were searching for a match, say, in the loop, and stopping on that match, then un-hiding the class-levelfiwould make sense, and the code you have will work. What specifically are you trying to do withfi?Also, the for loop you have won’t work as listed… should be:
* Update *
In response to your changes in the question, where are you getting this error? In the button click event? On which line? It sounds like a custom internal error to the DicomDirectory object, whatever that is.