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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:59:26+00:00 2026-06-06T20:59:26+00:00

I use a SQL Server CE database from my application. My program is located

  • 0

I use a SQL Server CE database from my application. My program is located on a DVD.

I cannot read data from the database on the DVD, I set SQL connection string mode to read only but it doesn’t work (I just want to read data from db)

ERROR:

Opening a database as read-only requires a temp path to be specified.
[ Db name = C:\Users\Ali\AppData\Local\Temp\Rar$EX52.280… ]

please help!

  • 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-06T20:59:28+00:00Added an answer on June 6, 2026 at 8:59 pm

    In order to open a SQL Server CE database file (SDF) on read-only media, you also need to add two additional parameters to the connection string

    • Mode=Read Only
    • Temp Path=[path]

    You could do this as follows:

    connectionString = String.Format(@"Data Source = {0}\{1};Mode = Read Only;Temp Path={2}", 
              dataBaseDirectory,
              dataBaseName, 
              System.IO.Path.GetTempPath());        
    

    If you are getting your connection string from App.Config

    see https://stackoverflow.com/a/10731515/19624

    string connectionString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
    connectionString += ";Mode = Read Only;Temp Path=" + System.IO.Path.GetTempPath()); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Use a Sql Server Compact Edition Database File For Store the Data in
I am planning for monitoring application which will use SQL Server 2005/08 database. It
I use C# program and my database is in SQL server 2008. When user
I'm trying to use SQL Server Management Studio to edit database tables. But I
We use web deploy packages to create and deploy a SQL Server database, when
I can use the sql server management studio to open a sqlserver 2000 database,
I just started to use SQL Server 2008. I have a winforms application that
I have a VB.NET application with a connection to an SQL Server 2003. On
Install SQL Server CE database in a separate folder, and application in other folder
I am working with a web application that connects to a SQL Server database

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.