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

  • SEARCH
  • Home
  • 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 7994821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:13:45+00:00 2026-06-04T14:13:45+00:00

Here are the 2 methods and the first error is complaining that I need

  • 0

Here are the 2 methods and the first error is complaining that I need a } where indicated below

I know this usually means I have a missing bracket somewhere but I don’t think that is the case and I can’t find anything wrong for the life of me.

    public Customer(string first, string last)
    {
        FileStream getID = new FileStream(FILENAME, FileMode.OpenOrCreate,         FileAccess.Read, FileShare.ReadWrite);
        String line;
        string[] fields;
        try
        {
            //Pass the file path and file name to the StreamReader constructor
            StreamReader srID = new StreamReader(getID);

            //Read the first line of text
            line = srID.ReadLine();
            while(line != null)
              {
                 fields = line.Split(DELIM);
                 if (Convert.ToInt32(fields[2]) > CustomerID)
                    {
                        CustomerID = Convert.ToInt32(fields[2]);
                    }
                 line = srID.ReadLine();
              }

            //close the file
            srID.Close();
        }
        catch(Exception e)
        {
            Console.WriteLine("Exception: " + e.Message);
        }

        FileStream customerWrite = new FileStream(FILENAME, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
        int idCounter;

        try
        {

            //Pass the filepath and filename to the StreamWriter Constructor
            StreamWriter sw = new StreamWriter(customerWrite);

            //Write a line of text
            FirstName = first;
            LastName = last;
            CustomerID += 1;
            sw.WriteLine(ToString());

            //Close the file
            sw.Close(); 
        }
        catch(Exception e)
        {
            // messagebox
            MessageBox.Show(e.Message,"Problem",MessageBoxButtons.OK, MessageBoxIcon.Error);
            //Console.WriteLine("Exception: " + e.Message);
        } // asking for a } here

        public new string ToString()
        {
           return (FirstName + ',' + LastName + ',' + CustomerID);
        }
    }

    // checks for duplicate customer info
    public bool CustomerOrderCheck(string first, string last) // gives the expected class... for the bool here
    // pass the first and last name to be checked in the system for a previous entry
    {
        FileStream customerCheck = new FileStream(FILENAME, FileMode.OpenCreate, FileAccess.Read, FileShare.ReadWrite);
        String line;
        string[] fields;
        bool customerExists = false;
        try
        {
            //Pass the file path and file name to the StreamReader constructor
            StreamReader sr = new StreamReader(customerCheck);

            //Read the first line of text
            line = sr.ReadLine();
            while (line != null)
            {
                fields = recordIn.Split(DELIM);
                FirstName = fields[0];
                LastName = fields[1];
                if (FirstName + LastName == first + last) //(line.Equals(orderCheck))
                {
                    MessageBox.Show("This order has already been submitted, please try again","Order already exists",MessageBoxIcon.Warning);
                    //Console.WriteLine("This order has already been submitted, please try again");
                    customerExists = true;
                    break;
                }
                line = sr.ReadLine();
            }

            //close the file
            sr.Close();
        }
        catch(Exception e)
        {
            Console.WriteLine("Exception: " + e.Message);
        }
        return customerExists;
    }
}
  • 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-06-04T14:13:47+00:00Added an answer on June 4, 2026 at 2:13 pm

    I think this:

            } // asking for a } here
    
            public new string ToString()
            {
               return (FirstName + ',' + LastName + ',' + CustomerID);
            }
        }
    

    should be:

            }// asking for a } here
        }
    
        public new string ToString()
        {
            return (FirstName + ',' + LastName + ',' + CustomerID);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Referring to the first answer about python's bound and unbound methods here, I have
Got this error for the first time, I have looked around and cannot find
Sort of a methods/best practices question here that I am sure has been addressed,
This question already has an answer here: What are Extension Methods? 5 answers Usage
I have a question regarding changing parameter types in virtual methods. First I'll explain
Using SubSonic v2.x: The first issue is the error discussed here : Server Error
First of all, I just started PHP. I know my methods might not be
So I keep getting this error that when I Google for it, the most
I have tried two different methods. The first is to specify the link in
This is a novice error for sure. In Xcode 4 i have created a

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.