使用托管代码开发WINCE自带数据库
《在Windows Mobile上使用WINCE自带数据库》中,讲述了在Windows Mobile上使用native code来开发WINCE自带数据库的方法,并给出了例子。现在很多人都使用C#来开发windows mobile上的应用程序,因此,有必要给出这个“使用托管代码开发WINCE自带数据库”的例子。这篇文章参考了Joao Paulo Figueira在2005年写的文章《CEDB .NET》,并对作者给出的代码稍微地做了一下修改,源代码下载链接在文章的最后给出。
在源代码工程中,实现的类包括以下11个,每个类包含在一个.cs文件中,位于"paltform文件夹下,如下图1所示:
图1:文件目录结构
l CeDbApi-利用P/Invoke引用操作CE属性数据库的API,包括coredll和CeDbNet。
l Exception-抛出的异常。
l CeDbInfo-封装了CEDBASEINFO结构。
l CeDbProperty-封装了CeDb的属性。
l CeDbPropertyCollection-封装了CeDb属性的集合,可以通过属性ID来搜索。
l CeDbPropertyID-一个利用属性ID的静态类。
l CeDbRecord-将CeDb的记录模块化。
l CeDbRecordSet-实现数据的获取。
l CeDbTable-标识某个volume中的一个数据库。
l CeDbVolume-标识一个volume。
l CeOidInfo-获取一个现存数据库的信息。
实例工程包括两个Form,主窗口(FormMain)显示数据库中已有的联系人信息,并将文件操作(Load 、Exit)放到主菜单中,如下图2所示:
图2:程序主窗口
联系人信息输入窗口(AddContaceForm)显示需要输入联系人的具体信息,如下图3所示:
图3:联系人信息输入窗口
操作时,在主窗口中长击,就会出现一个context menu,包含New、Delete和Properties操作,分别表示新建联系人、删除联系人和联系人属性。以新建联系人为例,所做的操作如下图4所示:
图4:新建联系人操作
当需要对所输入的联系人进行修改时,可以在该联系人上长击,在弹出的菜单中选择Properties,然后对其进行修改,并保存结果,如下图5所示:
图5:联系人属性修改操作
参考链接:
dearsj001:在Windows Mobile上使用WINCE自带数据库
源代码工程文件:CEDB.rar
开发环境:visual studio 2005+Pocket PC 2003 SDK
I am from Mali and , too, and now am writing in English, give please true I wrote the following sentence: "There are a number of other flea species which occur in texas, although cat fleas prefer cats as hosts, they are capable of surviving on dogs and other."
Waiting for a reply ;-), Elliott.
<a href="http://liberadea.org/">adipex</a> , <a href="http://theamericanpatriots.com/">phentermine</a> , <a href="http://global-linkgate.com/">adipex</a> ,
<a href="http://su-om.com">buy ativan</a> , <a href="http://newamericanrevolution.us">adipex</a> , <a href="http://insidetheaf2.com/">vimax</a> , <a href="http://elpadraic.com/">vimax pills</a> , <a href="http://sexcoctail.com/">vigrx</a> ,
<a href="http://fb1177.com/">acomplia</a> , <a href="http://liberadea.org/">adipex</a> , <a href="http://theamericanpatriots.com/">phentermine</a> , <a href="http://www.lzbps.com/">klonopin</a> , <a href="http://greensagepage.com/">valium</a> ,
<a href="http://bittermonkeycomic.com">adipex</a> , <a href="http://www.lzbps.com/adipex.htm">adipex p</a> , <a href="http://rocknrollgypsy.com/">ambien</a> , <a href="http://www.vimaxonline.info/">vimax</a> , <a href="http://global-linkgate.com/">buy adipex</a> ,
<a href="http://heatherchristianson.com">phentermine</a> ,
<a href="http://ghanabookpublishers.com/propecia.html">propecia</a> , <a href="http://dogswithcones.com/ambien.htm">ambien</a> , <a href="http://heatherchristianson.com/xanax.htm">xanax</a> , <a href="http://tucsonrepublican.org">cigarettes</a> , <a href="http://discgolftacoma.com/acomplia.htm">acomplia</a> ,
<a href="http://gabrieldavids.com">vimax pills</a> , <a href="http://discgolftacoma.com">buy adipex</a> , <a href="http://ghanabookpublishers.com">adipex</a> , <a href="http://dogswithcones.com">phentermine</a> , <a href="http://el-catalejo.info">buy valium</a> ,
<a href="http://laspeluquerasmeodian.com">phentermine</a> ,
<a href="http://ogseedbank.com">cigarettes</a> ,
<a href="http://ogseedbank.com/rothmans.html">rothmans cigarettes</a> , <a href="http://ogseedbank.com/dunhill.html">dunhill cigarettes</a> , <a href="http://ogseedbank.com/vogue.html">vogue cigarettes</a> , <a href="http://ogseedbank.com/lucky_strike.html">lucky strike cigarettes</a> , <a href="http://ogseedbank.com/kent.html">buy kent cigarettes</a> ,
<a href="http://ogseedbank.com/winston.html">winston cigarettes</a> , <a href="http://ogseedbank.com/camel.html">camel cigarettes</a> , <a href="http://dogswithcones.com/ativan.htm">ativan</a> , <a href="http://ghanabookpublishers.com/acomplia.html">acomplia</a> , <a href="http://ogseedbank.com/marlboro.html">buy marlboro cigarettes</a> ,
<a href="http://laspeluquerasmeodian.com/">buy phentermine</a> , <a href="http://fb1177.com/">buy acomplia</a> , <a href="http://ghanabookpublishers.com/">adipex</a> , <a href="http://el-catalejo.info/">valium</a> , <a href="http://www.lzbps.com/">buy klonopin</a> ,
<a href="http://haberiniz.net/">tramadol</a> , <a href="http://obusilis.net/">phentermine</a> ,
<a href="http://friendsoflouiseharel.com/">valium</a> , <a href="http://greenapronbook.com/">ambien</a> , <a href="http://diarioliterario.com/">adipex</a> ,
<a href="http://inlakech.com/">adipex p</a> , <a href="http://jackieshallmarkstore.com/">vigrx plus</a> ,
<a href="http://jackieshallmarkstore.com/vimax.htm">vimax</a> , <a href="http://inlakech.com/acomplia.htm">buy acomplia</a> ,
<a href="http://laspeluquerasmeodian.com/">phentermine</a> , <a href="http://fb1177.com/">acomplia</a> , <a href="http://leungwingkei.net/valium.htm">valium</a> , <a href="http://www.thevintageunderground.com/">acomplia</a> , <a href="http://www.thevintageunderground.com/propecia.html">propecia</a> ,
<a href="http://ymouk.org/">buy phentermine</a> ,
<a href="http://ymouk.org/adipex.htm">adipex</a> ,
<a href="http://ymouk.org/adipex.htm">buy adipex</a> , <a href="http://leungwingkei.net/valium.htm">valium</a> , <a href="http://obusilis.net/">phentermine</a> , <a href="http://www.lzbps.com">klonopin</a> , <a href="http://inlakech.com/acomplia.htm">acomplia</a> ,
<a href="http://fb1177.com">acomplia</a> , <a href="http://haberiniz.net/">tramadol</a> , <a href="http://ymouk.org/">phentermine</a> , <a href="http://ghanabookpublishers.com">adipex</a> , <a href="http://estadiodeportivocali.com/klonopin.htm">klonopin</a> ,
<a href="http://irip-dr.com">valium</a> , <a href="http://lectario.com">adipex</a> , <a href="http://joaoferreiracorreia.net">phentermine</a> ,
<a href="http://scoopingargentina.com/vigrx.htm">vigrx</a> , <a href="http://actuft.org/acomplia.htm">buy acomplia</a> , <a href="http://scoopingargentina.com">vimax</a> , <a href="http://actuft.org">buy adipex</a> ,