emulator for the Pocket PC

G

Guest

Ok, here is my issue, I have an app. that works find on the Pocket PC but,
fails to create the files and folders on the emulator. Here is the code that
fails.

If Not Directory.Exists(Me.mstrDir) Then
Directory.CreateDirectory(Me.mstrDir)
End If
'
' if the database exists...
'
If File.Exists(Me.mstrDB) Then
'
' connect...
'
If Me.mConn.State = ConnectionState.Closed Then
Me.mConn.Open()
Else
'
' look for the .CSV files to import...
'
Dim bFound As Boolean = File.Exists(Me.mstrDir & "File1.csv")
bFound = bFound AndAlso File.Exists(Me.mstrDir & "File2.csv")
bFound = bFound AndAlso File.Exists(Me.mstrDir & "File3.csv")
bFound = bFound AndAlso File.Exists(Me.mstrDir & "File4.csv")
bFound = bFound AndAlso File.Exists(Me.mstrDir & "File5.csv")

Any ideals on how to correct this to work?
I am using VB.Net.
 
G

Guest

The folder is not present so the create command is triggered, however the
folder is not being created so the files can not be uploaded. Again this
only fails on the emulator, the code works find on the device.
 
G

Guest

Private mstrDir As String = "\Application\Project\Database\"
Private mstrDB As String = Me.mstrDir & "Project.sdf"
 
D

Daniel Moth

1. How do you know the directory is not created, have you checked with
explorer?

2. So you are creating a directory. You then check to see if there is a file
in this *newly* created directory. Do you ever expect that to be true?

Cheers
Daniel
 
P

Paul G. Tobey [eMVP]

It fails, but *doesn't* generate one of the exceptions? Have you looked at
the return value for clues?

Paul T.
 
S

Sergey Bogdanov

I have tried to debug your code step by step? Maybe somewhere in your
application mstrDir modifies... To tell the truth, I'm sure that the
problem is not in the Directory.CreateDirectory(...).

Best regards,
Sergey Bogdanov
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top