?
Solved

windows mobile 6.5 vb.net application path and open data connection

Posted on 2011-03-10
2
Medium Priority
?
1,362 Views
Last Modified: 2013-12-27

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

Open in new window


gives an error
 question:
- 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")
conn.open()

Open in new window

0
Comment
Question by:IT-Factory
2 Comments
 
LVL 48

Accepted Solution

by:
Mikal613 earned 2000 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
0
 
LVL 2

Author Closing Comment

by:IT-Factory
ID: 35095771
yep this is what i needed, thanks
very fast solution...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

864 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