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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:42:48+00:00 2026-05-31T04:42:48+00:00

I getting a SqlException was unhandled error when I try to open the connection

  • 0

I getting a SqlException was unhandled error when I try to open the connection to the simple table I may in vs 2010. is there something wrong with my connection string? I copied the string out of the properties of the connection in server explorer. I pasted the full error and code below. Thanks

“A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)”

        InitializeComponent();

        SqlDataReader myDataReader;

        SqlConnection myConnection = new SqlConnection(@"DataSource=C:\Developement\KelseysChangeProject\Database1.sdf");

        SqlCommand myCommand = new SqlCommand("Select * From ChangeTable", myConnection);
        myConnection.Open(); <------ error happens here

        myDataReader = myCommand.ExecuteReader();



        myDataReader.Close();
        myConnection.Close();
  • 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-31T04:42:49+00:00Added an answer on May 31, 2026 at 4:42 am

    .sdf files are for SQL Server CE, which uses a different set of objects, such as SqlCeConnection (instead of SqlConnection) like you have. These are within the System.Data.SqlServerCe namespace.

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

Sidebar

Related Questions

I am currently getting this error: System.Data.SqlClient.SqlException: New transaction is not allowed because there
I am currently getting the error, java.sql.SQLException: Method 'executeQuery(String)' not allowed on prepared statement.
I'm getting a timeout error when trying to execute a LINQ (-to-SQL) query System.Data.SqlClient.SqlException:
I'm getting the SQLException Invalid Column Type whenever I try to use a parameter
I am getting the error: java.sql.SQLException: No suitable driver I have imported the .jar
I am getting following error in my query System.Data.SqlClient.SqlException: Incorrect syntax near the keyword
I am getting the following error: java.sql.SQLException: Exhausted Resultset at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at
i was getting this error com.ibm.db2.jcc.b.SqlException: Invalid argument: unknown column name COL1 when trying
java.sql.SQLException: Network error IOException: Connection timed out: connect at net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:410) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
I'm currently getting the error: java.sql.SQLException: ORA-01843: not a valid month which I assume

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.