Results 1 to 7 of 7

Thread: [RESOLVED] First little DB app - having problems

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [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:
    1. Imports System.Data.SqlServerCe
    2.  
    3. Public Class StuMobile
    4.  
    5.     Private Dcn As SqlCeConnection
    6.     Private Drc As SqlCeCommand
    7.     Private Drs As SqlCeResultSet
    8.     Private Drd As SqlCeDataReader
    9.  
    10.     Private Sub Find_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Find.Click
    11.         Drc = New SqlCeCommand
    12.         Drc.Connection = Dcn
    13.         Drc.CommandType = Data.CommandType.Text
    14.         Drc.CommandText = "Select * From Student Where LastName like '" & Find.Text & "%'"
    15.         Drd = Drc.ExecuteReader
    16.         Results.Clear()
    17.         While Drd.Read
    18.             Results.Items.Add(Drd(1))
    19.         End While
    20.     End Sub
    21.  
    22.     Private Sub StuMobile_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    23.         Dcn = New SqlCeConnection
    24.         Dcn.ConnectionString = "Data Source=\My Documents\Business\iPAQ.sdf; Password=xyz"
    25.         Dcn.Open()
    26.     End Sub
    27. End Class
    Seems to be getting this error:

    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?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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"?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    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.
    My usual boring signature: Nothing

  7. #7

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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...

    '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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width