Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1093959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:54:12+00:00 2026-05-16T23:54:12+00:00

There’s an error: The type being set is not compatible with the value representation

  • 0

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);
    } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:54:13+00:00Added an answer on May 16, 2026 at 11:54 pm

    I agree with Frederik, the local fi hides 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-level fi would make sense, and the code you have will work. What specifically are you trying to do with fi?

    Also, the for loop you have won’t work as listed… should be:

    //  Missing the 'in'
    foreach (string fi in files_in_folder)
    

    * 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is any way to set the generic type (T) of class in the
There is an error occurring in an app of mine when I set an
There is a <input type=checkbox name=option2 id=checkbox_3 value=3 /> I tried this code <script
There are many string matching algorithms can be used to find a pattern (string)
There doesn't seem to be any tried and true set of best practices to
There are many questions about this PersistenceException, but I have not seen some, where
There's an error when I post the code: Your post appears to contain code
There is a moment in my app, that I need to force to show
There is a column that exists in 2 tables. In table 1, this column
There's a Rails 3.2.3 web application which doesn't use any database. But in spite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.