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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:30:42+00:00 2026-05-17T20:30:42+00:00

I have done a web project ( using C# + SQL CE + ASP.NET

  • 0

I have done a web project ( using C# + SQL CE + ASP.NET )where it does few manupulation with .sdf file and results are displaye via ASP.net page . While i started working I hardcoded the path of the connection string and worked in my system . Now I want this database to be residing inside my server page.

How do i get the working directory( localhost) so
that i can put that in connection
string ?

I tried using

System.Environment.CommandLine but it throws me a error saying

"Format of the initialization string does not conform to specification starting at index 98." The outcome of System.Environment.CommandLine is

Data Source= "C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.EXE" /port:1438 /path:"C:\Documents and Settings\xxx\Desktop\Project\yyy\Deploy\EMSWEB\Back010\WEB\WEB" /vpath:"/WEB"/tEST.sdf;Persist Security Info=True;

Any idea ???

  • 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-17T20:30:43+00:00Added an answer on May 17, 2026 at 8:30 pm

    I finally made it work using

    connectionString="data source=|DataDirectory|\test.sdf"
    

    where as

     Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\
    

    Points to some directory like this below.

    C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.EXE" /port:1438 /path:"C:\Documents and Settings\xxx\Desktop\Project\yyy\Deploy\EMSWEB\Back010\WEB\WEB" /vpath:"/WEB"/tEST.sdf
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty big web application that I created last year using ASP.NET
I've done lots of java web development using jsps and servlets, and I have
I have an Events table whose goal is to store actions done by web
What things have to be done before I can honestly tell myself my web
I have a large .NET web application. The system has projects for different intentions
I am using Stripes for a project and have a situation I cannot understand.
I have done Java and JSP programming in the past, but I am new
I have done a bit of testing on this myself (During the server side
I have done a bit of research into this and it seems that the
I have done some searches looking for information about how to do logging with

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.