[RESOLVED] First little DB app - having problems
Ok - I create a SDF in VS2005 - copied it to the PPC and now I am trying to run this code - deploying it to the PPC - app starts and I can click the FIND button...
VB Code:
Imports System.Data.SqlServerCe
Public Class StuMobile
Private Dcn As SqlCeConnection
Private Drc As SqlCeCommand
Private Drs As SqlCeResultSet
Private Drd As SqlCeDataReader
Private Sub Find_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Find.Click
Drc = New SqlCeCommand
Drc.Connection = Dcn
Drc.CommandType = Data.CommandType.Text
Drc.CommandText = "Select * From Student Where LastName like '" & Find.Text & "%'"
Drd = Drc.ExecuteReader
Results.Clear()
While Drd.Read
Results.Items.Add(Drd(1))
End While
End Sub
Private Sub StuMobile_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dcn = New SqlCeConnection
Dcn.ConnectionString = "Data Source=\My Documents\Business\iPAQ.sdf; Password=xyz"
Dcn.Open()
End Sub
End Class
Seems to be getting this error:
Quote:
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
I'm just doing a quick proof of concept - thought this would work.
Should I not be copying the SDF to the PPC?
Re: First little DB app - having problems
Hi,
yes - you should be copying the SDF to the device.
Have you installed SqlMobile to the device?
Pete
Re: First little DB app - having problems
When I first ran the app - it appeared that VS pushed out some files...
What do you mean by "installed sqlmobile"?
Re: First little DB app - having problems
Hi,
there are a couple of cab files that will do a full install SqlMobile on the device, along with a query analyser.
Look for sql.dev.enu.ppc.wce4.armv4.cab for the dev install, and sqlce30.*.cab depending on your device
Pete
Re: First little DB app - having problems
Thanks...
I left the office - going back in a couple of hours - I'll continue to fool with it then.
Did some googling and found links like this:
http://forums.microsoft.com/MSDN/Sho...32465&SiteID=1
Seems I'm probably not catching prior errors.
Re: First little DB app - having problems
If you debug on a hardware device, SQLServerCE will be installed the first time you run the debugger.
I think catching some specific exceptions would help....but you already stated that.
Re: First little DB app - having problems
Wow - what a nightmare this is for me...
I barely use VB.Net as it is - still stuck in VB6 for the most part.
Now I'm doing a CE app using .Net - and CE app's don't allow full .Net syntax.
For example - the overloads for LISTVIEW add don't exist - so I had to change it to this:
Code:
Results.Items.Clear()
While Drd.Read
Dim lwi As New ListViewItem
lwi.Text = Drd(1)
Results.Items.Add(lwi)
End While
and now it's working - so it had nothing to do with the exception I posted - which still occurs...
Quote:
'iPAQ Test 2.exe' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\mscorlib.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'c:\documents and settings\szlamany\my documents\visual studio 2005\projects\ipaq test 2\ipaq test 2\bin\debug\iPAQ Test 2.exe', Symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\System.Windows.Forms.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\System.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\System.Drawing.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'c:\program files\microsoft visual studio 8\smartdevices\sdk\sql server\mobile\v3.0\System.Data.SqlServerCe.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\System.Data.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\System.Xml.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\Debugger\BCL\Microsoft.VisualBasic.dll', No symbols loaded.
'iPAQ Test 2.exe' (Managed): Loaded 'System.SR.dll', No symbols loaded.
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
At any rate - this error is still showing in the OUTPUT window but it's not stopping the process from running - and according to that MSDN forum link it's ok to ignore.