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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:39:08+00:00 2026-06-05T06:39:08+00:00

This question is related to this previous SO question I have fixed the string

  • 0

This question is related to this previous SO question

I have fixed the string used in the program so it now runs that line of code.

Why does the following fail on the line myAdapt.Fill(mySet, "AvailableValues"); with a error SQLException was Unhandled; 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

The database is part of the project so why should there be difficulties connecting?

  • I’ve tried running the sql string in a sql file and it runs ok.
  • I’ve tried deleting all columns from the DGV.

    void PopulateGridView()
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseDGVexperiments.Properties.Settings.DatabaseDGVexperimentsConnStg"].ConnectionString);
        SqlDataAdapter myAdapt = new SqlDataAdapter("SELECT refText FROM helloworld", conn);
        DataSet mySet = new DataSet();
        myAdapt.Fill(mySet, "AvailableValues");
        DataTable myTable = mySet.Tables["AvailableValues"];
        this.uxExperimentDGV.DataSource = myTable;
    }
    
  • 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-05T06:39:11+00:00Added an answer on June 5, 2026 at 6:39 am

    Are you trying to open a SqlCE file (SDF) with SqlConnection?
    I think you should a use SqlCeConnection and the ADO.NET classes specific for Sql Compact

    using System.Data.SqlServerCe;
    .....
    
    void PopulateGridView() 
    { 
        SqlCeConnection conn = new SqlCeConnection(ConfigurationManager.ConnectionStrings["DatabaseDGVexperiments.Properties.Settings.DatabaseDGVexperimentsConnStg"].ConnectionString); 
        SqlCeDataAdapter myAdapt = new SqlCeDataAdapter("SELECT refText FROM helloworld", conn); 
        DataSet mySet = new DataSet(); 
        myAdapt.Fill(mySet, "AvailableValues"); 
        DataTable myTable = mySet.Tables["AvailableValues"]; 
        this.uxExperimentDGV.DataSource = myTable; 
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is related to a previous question of mine That's my current code
This question is related to my previous question . The storyline: I have an
This is a related to a previous question I have asked here, see the
This is related to my previous question , but a different one. I have
This is related to a previous question I asked with Jquery. If I have
This is related to a previous question . What I'm trying to understand now
This is related to my previous question , but it seems I have another
This is closely related to a previous question i asked. I have a many-to-many
This question is related to my previous question Link The method bellow does excatly
This is somewhat related to my previous question but I've realised that I needed

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.