How to fix "the name txt does not exist in the current context"?

Kio 0 Reputation points
2025-01-29T23:24:21.8933333+00:00

ss

ss2

Developer technologies | C#
{count} votes

2 answers

Sort by: Most helpful
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2025-01-30T01:15:38.5066667+00:00

    Hi @Kio ,

    Ensure that the name is spelled correctly and matches the case exactly as defined. C# is case-sensitive, so txt and Txt would be considered different names

    Try clear and rebuild the solution.

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Olaf Helper 47,516 Reputation points
    2025-01-30T06:54:28.8833333+00:00

    I don't see anything SQL Server related.

    And you get the error because by your screenshot the variable/object "txt" is nowhere declared.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.