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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:13:02+00:00 2026-05-15T15:13:02+00:00

Using VC# I’ve created a staff management app that, upon its first run, is

  • 0

Using VC# I’ve created a staff management app that, upon its first run, is expected to query the user for the path to a (.mdf) database which will reside on a remote computer. A resulting path may be something like

string dbPath = @"P:\remoteComputer\public\StaffTool\ExamplePersonnelDatabase.mdf";

Then I’m placing this string into a connection string template as so:

string dbConnectTemplate = @"Data Source=.\SQLEXPRESS;AttachDbFilename={0};Integrated Security=True;Connect Timeout=30;User Instance=True";
string dbConnectionString = String.Format(dbConnectionTemplate,dbPath);

Then I’m attempting to connect to the database LINQ to SQL style

ManagementDBDataContext db = new ManagementDBDataContext(
                dbConnectionString);

At this point, an error pop’s up stating that

The file "P:\remoteComputer\public\StaffTool\ExamplePersonnelDatabase.mdf" is on a network path that is not supported for database files.

An attempt to attach an auto-named database for file P:\remoteComputer\public\StaffTool\ExamplePersonnelDatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

As I am relatively new to databases, I completely do not understand this message. And obviously, the file is not on a UNC share.

Any ideas?


Jim Lamb recommended that I connect to an instance of SQL server running remotely. Considering that I’m using LINQ to SQL, what refactoring do I have to do to make this happen? Other ideas still welcome – especially "push this button and everything will work" solutions.


Another clue: A coworker said that there used to be some way to work through Control Panel->Administrative Tools->Data Sources(ODBC) so that a remote database could be viewed from my computer as if it was local. The coworker didn’t know any more details besides this.

  • 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-15T15:13:02+00:00Added an answer on May 15, 2026 at 3:13 pm

    You are attempting to connect to a database file on another machine over a network connection, which isn’t supported by SQL Express. You’ll need to make a local copy and attach to that, or connect to an instance of SQL that’s running on the same machine as the MDF file.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
Using C#, I need a class called User that has a username, password, active
Using CI for the first time and i'm smashing my head with this seemingly
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Using mercurial, I've run into an odd problem where a line from one committer
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
Using report builder 3.0, I have a report that queries a cube. How do
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for

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.