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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:55:04+00:00 2026-06-05T14:55:04+00:00

Basically what I am trying to do is run a small WPF program, where

  • 0

Basically what I am trying to do is run a small WPF program, where the user will select a SQL Server Compact database and my program will show them specific information from a specific table.

Where I am having trouble is the connection string, I want the user to be able to browse to the location where their database is saved, and not make them have it in the one location (if that makes sense)

I can get my program to work if I have the database in one location with a specific name, but the databases the user will want to check the information for will all have different names but all will have the same file extension

e.g. the code I have at the moment is this:

string Myfile = @"C:\Users\documents\visual studio 2010\debug\FILE.sdf";
SqlCeConnection localDatabaseConn = new SqlCeConnection("data base = " + Myfile +";

I can get the result I want when I have the file saved to a specific location with a specific name, but I want the user to be able to browse to their own file, which will have a different name and could be anywhere on their machine.

Any help would be appreciated

  • 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-05T14:55:06+00:00Added an answer on June 5, 2026 at 2:55 pm

    So, basically it seems you want an OpenFileDialog.

    Example:

    Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
    dlg.DefaultExt = ".sdf";
    dlg.Filter = "Database file (.sdf)|*.sdf";
    
    Nullable<bool> result = dlg.ShowDialog();
    
    if (result == true)
    {
        string Myfile = dlg.FileName;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, i am trying to determin if an application made for 1.x will run
Basically I'm trying to run some code (Python 3.2) if a value on a
I'm trying to run this script that basically reads/interprets text in from a textfile
I'm trying to run a query on DBPedia.org via SPARQL. Basically, here's what I
I am trying to use JSON to populate a div, so I basically run
I'm basically trying to create a url friendly query string with user input. The
What im basically trying to do is to confirm the identity of the user
I am trying to run a program in C for x minutes. I need
I am basically trying to create a new database and enter the database values
Im trying to run this code . Basically I want the https://admin:qwerty123@ '$dmp':7777/set_param?'$params command

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.