windows mobile 6.5 application path and open data connection

Posted on 2011-03-10
Last Modified: 2013-12-27

conn = new sqlceconnection("Data Source=db.sdf")

Open in new window

gives an error
- how to know the path the application is run in?
- how to give the right path to the db file e.g. Mobile Device/program files/appname/db.sdf

conn = new sqlceconnection("Data Source=db.sdf")

Open in new window

Question by:IT-Factory
LVL 48

Accepted Solution

Mikal613 earned 500 total points
ID: 35095181
Imports System.Reflection

Public Function GetAppPath() As String

Dim asm As [Assembly] = [Assembly].GetExecutingAssembly()

return System.IO.Path.GetDirectoryName(asm.GetName().CodeBase)

End Function

Author Closing Comment

ID: 35095771
yep this is what i needed, thanks
very fast solution...

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator ( This article presumes a wor…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question