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 8298597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:50:14+00:00 2026-06-08T15:50:14+00:00

Can anyone please point out the cause of this error in the C# code

  • 0

Can anyone please point out the cause of this error in the C# code of an ASP.Net application.
The build error is expecting a closing curly brace, although I have checked for all semicolons and brackets, but could not exactly pinpoint it. Any leads will be appreciated. Thanks!

Here is the code followed by the screen shot.

using System;
using System.Collections.Generic;
//using System.Linq;
//using System.Web;
using System.Data.SqlClient;
using System.Configuration;


    namespace ANTrack
    {
        public class MyObjDataSource
        {
            public int iCount;
            public string strName;

            public void GetIncident(int IncidentID)
            {
                private SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
            }
        }
    }

Closing Curly Brace Error

  • 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-08T15:50:15+00:00Added an answer on June 8, 2026 at 3:50 pm

    I think it has to do with the line:

     private SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
    

    You don’t want to put a private in front of that, it’s a variable in a method.

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

Sidebar

Related Questions

Can anyone please point out what im doing wrong with this Stored Procedure please.
Can anyone please help me to point out as what is the error in
Please can anyone point out my mistake in this: String j = SELECT +
Can anyone please point out why I get the syntax error: expected expression before
Trying to learn PL/SQL with multimedia data. Can anyone please point out that from
Can anyone point out a turorial which explains threading?? In my application, i'm uploading
Can anyone please, point out some good tutorials, to develop a front end gui
Can anyone please point out what is wrong with the following SQL statement: SELECT
Please can anyone one point me to a good tutorial that helps me to
Can anyone please tell me how to extract this kind of data : [{number:8457215152,type:Cell,state:LA,country:US,tz:CT,zip:70546,msa:0},{number:4363685555,type:Cell,state:LA,country:US,tz:CT,zip:70546,msa:0}]

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.