Results 1 to 10 of 10

Thread: How To Use Databse On Pocket PC ?

  1. #1

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    How To Use Databse On Pocket PC ?

    I'm newbie for pocket pc application and i have problems for the database in Pocket PC App ?
    How to Connect the SQL CE in VB.NET 2003 Pocket PC ?

    I has been created the application with VB.NET 2003 Pocket PC, but it not connect to Database. For the database i use the ARRAY Data only, but it not dinamis.

    Please halp me. Step by step to User SQL CE Database ?

    thanks

  2. #2
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: How To Use Databse On Pocket PC ?

    heres a link to the comact framework tutorials
    http://samples.gotdotnet.com/quickst...pactFramework/

    this shows samples of using sqlce in vs2003
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  3. #3

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Re: How To Use Databse On Pocket PC ?

    ok. i has been try for your link.

    but i have problem, when installaion on pocket pc ?
    my error like this:
    This Application requies newer version of the Microsoft .NET Compact Framework then the version installed on this device

    and my code on program like this :
    VB Code:
    1. Function createDB() As Boolean
    2.         Dim pathDir As String = "\My Documents\Personal\Contacts.sdf"
    3.         Dim status As Boolean = False
    4.         Try
    5.             ' Delete the SQL Mobile 2005 Database file
    6.             If File.Exists(pathDir) = False Then
    7.                 status = True
    8.                 File.Delete(pathDir)
    9.  
    10.                 ' Create a new database
    11.                 Dim engine As New SqlCeEngine("Data Source = \My Documents\Personal\Contacts.sdf")
    12.                 engine.CreateDatabase()
    13.             End If
    14.             ' Create and open connection.  The SqlCeResultSet requires the
    15.             ' connection to be open to perform various functions
    16.             conn = New SqlCeConnection("Data Source = \My Documents\Personal\Contacts.sdf")
    17.             conn.Open()
    18.  
    19.  
    20.             If status Then
    21.                 ' Create Command
    22.                 cmd = conn.CreateCommand()
    23.                 cmd.CommandText = "CREATE TABLE Contact (ID INT, First NVARCHAR(20), Last NVARCHAR(30), Phone NVARCHAR(20), EntryDate DATETIME)"
    24.                 cmd.ExecuteNonQuery()
    25.             End If
    26.             ' Create ResultSet
    27.             cmd.CommandText = "SELECT * FROM Contact"
    28.             rs = cmd.ExecuteResultSet(ResultSetOptions.Updatable Or ResultSetOptions.Scrollable)
    29.  
    30.             '' Bind the result set to the DataGrid
    31.             ContactDataGrid.DataSource = rs.ResultSetView
    32.  
    33.             ' Add records for demonstration purposes
    34.             Dim i As Integer
    35.             For i = 0 To 9
    36.                 Dim idxStr As String = i.ToString()
    37.                 AddRecord(rs, "First" & idxStr, "Last" & idxStr, "555-100" & idxStr)
    38.             Next i
    39.             Return True
    40.         Catch ex As Exception
    41.             Return False
    42.             MessageBox.Show("Error: " & ex.Message)
    43.         End Try
    44.     End Function

    1. what must i do before i intall my Mobile application to pocket pc ?

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

    Re: How To Use Databse On Pocket PC ?

    Is that installing on your device, or trying to run it on your device using VS2003?

    What version is installed on your PPC? Run cfgacutil.exe from the windows folder on your PPC - that will tell you which version is installed on your device.

  5. #5

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Re: How To Use Databse On Pocket PC ?

    I has been try on Emulator use the sql ce programming and it success.
    but when i try to start my program on pocket pc it not success, becouse my pocket pc there is not SQL CE software.

    I has download the SQL CE for mobile but that file .msi Extention not .exe. my pocket pc is not detection the .msi extention, so i can't install sql ce on my pocket pc, and i don't know that the file is true (sql ce or not). where i can download the sql ce for mobile not .msi file ?

    my pocket pc version is 2003

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

    Re: How To Use Databse On Pocket PC ?

    Hi,
    when you deploy your program using VS2003, it will deploy SqlCe for you.
    Otherwise, you need sqlce.wce4.armv4.cab copied to your device, and then click on it to install.

    The easiest way to do it is run VS2003, attach your device, and then with the targe set to the device, click on f5 to run

    Pete

  7. #7
    Addicted Member
    Join Date
    Dec 2006
    Location
    Georgia
    Posts
    170

    Re: How To Use Databse On Pocket PC ?

    True or False: As far as distributing any PDA applications, I will need to include this sqlce.wce4.armv4.cab with my application.

    If True, where do I obtain this file?

  8. #8
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: How To Use Databse On Pocket PC ?

    Wherever you installed Microsoft Visual Studio
    eg:
    C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\wce400\armv4

    here you will find the sqlce.wce4.armv4.cab, also you may wish to distribute the sqlce.dev.wce4.armv4.CAB as it gives better error messages to the user should there be a database exception.

    I also distribute the System_SR_enu.cab found in
    C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\Diagnostics
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  9. #9
    Addicted Member
    Join Date
    Dec 2006
    Location
    Georgia
    Posts
    170

    Re: How To Use Databse On Pocket PC ?

    Thanks for the directories. (I use VS2005, but I'm sure the paths are very similar). Now how to wrap all these files up into a nice, user-friendly installation package...?

  10. #10

    Thread Starter
    Addicted Member Tengkorak's Avatar
    Join Date
    Nov 2006
    Posts
    240

    Re: How To Use Databse On Pocket PC ?

    thank for your answer.

    now i has install the sql ce to ppc.

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