CEDB Managed Wrapper

Last post 02-05-2007 0:04 by Anonymous. 30 replies.
Page 1 of 3 (31 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 02-14-2003 9:23

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 1,868

    CEDB Managed Wrapper

    Locked Reply Contact
    Credit: Elia Karagiannis

    Download the source code here
  • 07-19-2003 9:35 In reply to

    Re: CEDB Managed Wrapper

    Can I access to Pocket Access DataBase?
    Can I run a "Update" SQL statement?

    thanks.

    .tolemac.
  • 08-26-2003 7:55 In reply to

    Re: CEDB Managed Wrapper

    How to install it? I uploaded "System.Data.CeDB.dll" file to \WINDOWS on Pocket PC 2003 and then run TestCEDatabase.exe but got the Exception:
    A managed TypeLoadException occured at Application::Run+0xf
    I tested it with ObjectStore and CDB files with same result.
    And I also tested put dll and exe into same directory, again the same error.
    Thanks
    Leonell


    quote:
    Originally posted by ctacke

    Credit: Elia Karagiannis

    Download the source code here

  • 09-11-2003 6:36 In reply to

    Re: CEDB Managed Wrapper

    I had (almost) the same problem.
    I copied the System.Data.CeDB.dll file to my device's
    \Windows directory, ran the TestCeDBProvider program,
    and when I tried to open a .cdb file or a database in
    the Object Store, I'd get the following error:

    System.MissingMethodException:MissingMethodException

    (We really must start up a .Net Error Message
    Appreciation Club..!!)


    Any suggestions..?


    Michael
  • 09-11-2003 6:41 In reply to

    Re: CEDB Managed Wrapper

    By the way, the exception is caused by either of the
    two "new CEDBConnection" statements in TestCeDBProvider's
    MainForm.cs:

    if(databaseFilePanel.Visible == true)
    {
    // Blah blah blah

    // if you want to create a connection to an access database, do this
    con = new CeDBConnection(databaseName.Text);
    }
    else
    con = new CeDBConnection(); // just create a connection to the object store


    Michael
  • 09-13-2003 7:13 In reply to

    Re: CEDB Managed Wrapper

    Hallo,

    First thank you Chris for posting the control. I am testing it just now.
    I did not have any problems installing the control. But I am still struggling with speed (Oh yeah, .NETseems to be very slow on my xda) [:(][xx(][V] But I have to use it, my boss forced me [:(!][:(][xx(]
    Ok, it is much better than eVB [:)][:p][:D]

    How to Install:

    1. Copy the unmanaged DLL to the windows directory on the device
    2. Add the managed classes to the project (or solution), hey I am working with .NET since a few days [;)] I still do not know the difference.
    3. Add the necessary Referencies system.data.cedb and system.data.common to the project,solution

    My first code looks like this:

    Private ds As System.Data.DataSet
    Private adapter As System.Data.CeDB.CeDBDataAdapter
    Private con As System.Data.CeDB.CeDBConnection

    'create connection to the data store
    con = New System.Data.CeDB.CeDBConnection
    ' create a dataset
    ds = New System.Data.DataSet
    ' create an adapter
    adapter = New System.Data.CeDB.CeDBDataAdapter
    ' ok create the recordset
    adapter.SelectCommand = New _ System.Data.CeDB.CeDBCommand(strSQL, con)
    ' fill table 0 of the dataset with the values of the recordset
    adapter.Fill(ds)
    'ok use the datagrid
    objList.DataSource = ds.Tables(0)

    Sure it is not a very effective way [xx(] it works but it needs a long
    8 seconds to fill the datagrid with 1000 records. Why is palm so much faster[V][xx(][:(!]
    I still do not understand the concept of the datareader, or do i have to do paging with fill(ds, startindex,number of records, tablename) ???
    But the advantage is , it works with datagrid, even tableformating works quite well. [:0][:p][}:)]

    Thanks again:

    Chris
    Kingdom of Thailand





    www.hotelthailand.com
    The great Hotel & Resort Reservation System
  • 09-15-2003 14:55 In reply to

    Re: CEDB Managed Wrapper

    Hello All,

    great library. I can read Pocket Outlook data without any problems.
    I also tried to write an update method but it doesnt work although it doesnt give me any error.

    Here is the code i use. Any help or comments would be appreciated:

    con is set to an Pocket Access db outside this method.

    Sub updateData(sql As String)

    Dim adoComm As New CeDBCommand
    adoComm.CommandText = sql
    adoComm.Connection = con
    adoComm.ExecuteNonQuery()

    End Sub

    Any ideas why it doesnt work ? I use the same method to update an sqlce db with success.
    I was also wondering how to write an update statement using the update command of the adapter.
    Any ideas on that?

    Thanks,
    Michael
  • 10-20-2003 4:04 In reply to

    Re: CEDB Managed Wrapper

    Thanks to Chris for excellent help, thanks for provider too.
    Now it works but I cannot read data :-(
    I want to read data from Contacts database. No success.
    I tested it with PC2002 emulator and WM2003 physical device with same results.
    Thanks for your help.
    Leos

    Here is my code:

    try
    {
    con = new CeDBConnection(); // Open Object store
    ds = new DataSet();
    // Appointments Database
    // Contacts Database
    // Tasks Database
    adapter = new CeDBDataAdapter();
    adapter.SelectCommand =
    new CeDBCommand("select * from 'Contacts database'", con);
    // Fill statement return:
    // for MSysFields : System.Overflow Exception
    // for MSysTables : System.FormatException
    // for MSysProcs : System.Exception Type unknown
    // how to add two words table name "Contacts Database"?
    // Using " or ' return no data.
    // Wrong tablename doesnt return error but no data.
    adapter.Fill(ds);
    dataGrid1.DataSource = ds.Tables[0];
    con.Close();
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }
  • 10-31-2003 10:44 In reply to

    Re: CEDB Managed Wrapper

    Originally posted by mozzak

    Hello All,

    >> great library. I can read Pocket Outlook data without any problems.
    >> I also tried to write an update method but it doesnt work although it doesnt give me any error.

    Hi, I'm fighting to get any data from the Pocket Outlook. I can open the Object Store, but I don't know, how to query the Appoitments.

    Can anybody help? Can you send a snippet of your code, how do you read / write Pocket Outlook?

    Thanx,

    Jan
  • 11-09-2003 6:34 In reply to

    Re: CEDB Managed Wrapper

    Hallo

    Not much going on here. That's very sad. I am still struggling
    also with this control. But first let me try to answer the previous questions ( I could be very wrong) It looks like that this
    control is build on the ADOCE C++ wrapper from Virtual Office Systems Incorporated and has all the unfortunate bugs of this wrapper Blob,
    Text Fields for example. It is also using adoce.3.0 hardwired.
    "Contacts database" is in my believe, (I could be wrong) not a ADOCE
    Table, but an operating system database which can be manipulated using
    API calls like CEOpenDatabase e.t.c. (No idea how to manipulate them in VB.NET yet) [:(!]. So you can't use this control for POOM tables.
    I managed to open tables which I previously created using Odysseys
    ADOCE wrapper. It works. It should be also possible to create tables
    using the cedbcommand object. ADOCE does not support the Update
    SQL command only the Insert and Delete Command. This explains why
    Update will fail (not implemented) I guess SQLCE has a update sql
    statement.

    The datareader seems to return
    a recordset type thing, and here is were my problem starts:
    the getSchemaTable method. I thought it should return a DataTable
    containing all the necessary information of the datareader. Unfortunately it does not return a filled datatable with the information:

    Looking into the source code I think this whole thing is quite strange:

    public DataTable GetSchemaTable()
    {
    DataTable t = new DataTable(); // creates a new table

    // find the name of the table by parsing the select statement
    string tableName = null;
    string[] vals = cmdText.Split(' ');
    for(int z = 0; z < vals.Length; z++)
    {
    if(vals[z].ToLower() == "from")
    {
    if(z != vals.Length - 1)
    tableName = vals[z+1];
    break;
    }
    }
    t.TableName = tableName;

    // *****************************************************************
    // This part looks very strange to me,
    // it seems it returns a table with exactly
    // the same structure as the recordset.
    // No rows are added to the table, so I think
    // this is not the purpose of a Schema Table.
    // A Schema Table should describe one Column in a DataReader
    // object per Record.
    // At least SQL CE seems to work like this (Documentation)
    // I am not using SQL CE so I can't be sure.
    // *****************************************************************

    // go through all the fields, find the column names and add them to the dataset

    for(int x = 0; x < this.FieldCount; x++)
    {
    try
    {
    t.Columns.Add(this.GetName(x), this.GetFieldType(x));
    }
    catch(Exception ex)
    {
    string str = ex.Message;
    }
    }

    return t;
    }


    Conclusion:

    Also the idea is very nice having a wrapper for ADOCE tables, the
    result is not yet satisfying. The implementation of the DataReader seems not to work like a SQLCE datareader, but this should be the goal.

    Sincerely

    Chris
    Bangkok/Thailand

    P.S.: Just now I am using Odyssey's ADOCE wrapper, but I would like to
    get rid of this control: Three reasons:
    It's leaking Memory like hell if you are not careful (Discard
    every field, fields .e.tc. object). It is very slow. It does not work together the databound controls like datagrid. Maybe I try IntheHand
    next (Also I am afraid of a failure again, and without sourcecode
    somebody like me is lost in space) SQLCE is not a solution for me.
    First I am not using SQL Server at all in my office. Second: My Backend
    is a nice AS/400 running DB2. Third I am using Apache and not IIS
    for HTTP transfer.

    www.hotelthailand.com
    The great Hotel & Resort Reservation System[:(!]
  • 11-12-2003 21:58 In reply to

    Re: CEDB Managed Wrapper

    Has anyone gotten the test program that came with this working ?

    I copied System.Data.CeDB.dll to "C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE"
    This allowed me to add the reference easily.

    I then copied CeDBWrapper.dll to my Pocket PC in the \Windows directory.
    This got rid of the Missing exception errors i was getting.

    Now i try to open a .cdb file i converted from access2k and I am getting
    "System.Exception:Type Unkown"

    I am fairly new to this, so please let me know if I set it up wrong.

    Also, will CeDBWrapper.dll work for a pocketPC emulator, or will I need to recompile it for that architecture?

    I am actually trying to do something quite simple, sync an access phone database to the Pocket PC and create a simple UI for it on the PPC. I wanted to make sure this wrapper worked before i got into it though.

    If any one has any clue how to get this to work, please reply and let me know. Thanks.
  • 12-09-2003 15:37 In reply to

    Re: CEDB Managed Wrapper

    I too am experiencing problems getting the the test application to work.

    I have the System.Data.CeDB.dll in the same directory as the .exe and CeDBWrapper.dll in my windows directory. When I start the app I and try to open something I get "A managed TypeLoadException ocurred..."

    In my own piece of code I notice the following line of code causes the error:

    System.Data.CeDB.CeDBDataAdapter adapter = new CeDBDataAdapter();

    Can anyone help?


  • 12-15-2003 6:06 In reply to

    Re: CEDB Managed Wrapper

    Hi,
    can anyone tell me if its possivel to use this wrapper with oracle lite? can anyone tell me how?

    Nelson
  • 12-16-2003 10:52 In reply to

    Re: CEDB Managed Wrapper

    quote:
    Originally posted by ctacke

    Credit: Elia Karagiannis

    Download the source code here


    Please explain what does this code do??
    We are new developers on pocket pc (C# CF.NET) and we are trying to transfer OFFICE ACCESS database tables from desktop to device (and the way round). We want to be able to see records on the pocket pc's screen.
    Please answer me in details.
    thanks very much!!!!!!
    aviad
  • 12-18-2003 5:31 In reply to

    Re: CEDB Managed Wrapper

    I develop software for the web, desktop, and PocketPC. For a variety of reasons, I use MS Access ("MSA") quite a bit. In Embedded Visual Basic (eVB) there was a control used to access MSA, and ActiveSync provides a mechanism to sync selected tables from MSA to "Pocket Access". Microsoft provided no such control for Compact Framework ("CF"), even though you can use .NET on the desktop (or web if you use ASP.NET with IIS) to access MSA data. Consequently, there are third party controls which are promoted as providing the missing link. One which I've heard about can be found at www.inthehand.com. I have not tried any of them, as I do not like to use (due to issues of security and data integrity) certain types of code (i.e., data access wrappers) from third parties unless I have the source code, "just in case"... The work around which I use is to create .xml files which can be easily synced using ActiveSync (by placing the files into the "sync file folder"). Alternatively, I use WebServices to sync by passing datasets. There are other ways to do this, but it would be nice to be able to have a reliable, open source conversion control, which is what this thread is supposed to provide. I have not looked at it, though, as there have been so many posts by people who have had problems. Hopefully, they will work it out.

    Otherwise, you can stick with eVB. You might also check out www.deVBuzz.com.

    Sanford ("Sandy") J. Asman
    Attorney at Law
    570 Vinington Court
    Atlanta, GA 30350

    Phone: (770) 391-0215
    Fax: (770) 668-9144
    Email: sandy@asman.com
Page 1 of 3 (31 items) 1 2 3 Next >