Solved

Error on fill datatable when deploying form to Windows Mobile Emulator

Posted on 2012-03-30
4
776 Views
Last Modified: 2013-12-27
Hi all,

Using Visual Studios 2008, .net 3.5, vb

I'm trying to deploy a form to a windows mobile emulator (and then device, of course). I've associated the combo boxes on the form with lookup tables. Yet everytime I try to debug, I get stopped with the following error at this line of code that VS is generating itself (full code block below):

Dim returnValue As Integer = Me.Adapter.Fill(dataTable)

I'm told that "The database file cannot be found. Check the path to the database. [ Data Source = \Program Files\VTCI_CEL1\SQL_CE_CEL5.sdf ]".

Do I need to drop the database onto the device first? But then how would I get the emulator to work?

Super new to all this, so I appreciate any and all advice.
Cheers,
Caitlin


        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
         Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, True)> _
        Public Overridable Overloads Function Fill(ByVal dataTable As SQL_CE_CEL5DataSet.lkpiTreeDataTable) As Integer
            Me.Adapter.SelectCommand = Me.CommandCollection(0)
            If (Me.ClearBeforeFill = True) Then
                dataTable.Clear()
            End If
            Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
            Return returnValue
        End Function
0
Comment
Question by:RJT_VT
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 37788275
Were is the database on the device?
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 250 total points
ID: 37788278
You definitely need the database on the device:

Heres how:

http://www.smartmobiledevice.co.uk/HowTo/SetupStorageCardForEmulator
0
 
LVL 24

Accepted Solution

by:
alexey_gusev earned 250 total points
ID: 37788298
alternatively, you could just start the emulator first and then even craddle it so it behaves like (well, nearly) read device => look for Device Emulator Manager uander Tools menu in VS.

you can also mark sdf (assuming it is included in your project) as 'Content' and choose to deploy it e.g. if it is newer than on the device/emulator
0
 

Author Closing Comment

by:RJT_VT
ID: 37789940
This beginner thanks you both for your advice! The two approaches have worked beautifully -- I've configured the shared folder and learned how to cradle the device beforehand.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now