Blog Home  Home RSS 2.0 Atom 1.0 CDF  
.NET (Compact) Framework - Compact Framework
Haggy's technischer BLog
 
 Tuesday, June 05, 2007
Das Problem dass sich die KalenderWochen nach FirstFourDayWeek nicht IsoKonform verhalten wurde mir von Microsoft bestätigt. Ein Datum bei dem man dieses abweichende Verhalten festestellen kann ist z.bsp. der 31. Dezember 2003 (Mittwoch) mit einer mit GetWeekOfYear erhält man 53 , Isokonform wäre es aber die 1. Kalender Woche.

Der 1. Januar (Donnerstag) wäre übrigens  auch mit GetWeekOfYear die 1. KW. Laut Isonorm liegen aber alle Tage einer Woche immer in der gleichen Kalenderwoche deswegen wohl die Abweichungen

s. http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=276185

Dort wird auch ein Workaraound empfohlen den ihr unter : http://blogs.msdn.com/shawnste/archive/2006/01/24/iso-8601-week-of-year-format-in-microsoft-net.aspx finden könnt.

Microsoft denkt nun drüber nach wie man es am geschicktesten implementiert dass man die Kalenderwochen berechnung konfigurierbar IsoKonform gestalten kann

6/5/2007 7:05:55 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | .NET Allgemein | Bugs | C# | Compact Framework | CultureInfo / Globalization  | 
 Tuesday, February 06, 2007
Das Forum zum .NET (Compact) Framework ist nun unter http://smartdevelopment.de/forums/default.aspx online.

Viel Spaß beim Austausch mit gleichgesinnnten! ;-)

2/6/2007 1:28:36 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | .NET Allgemein | BLogs | Compact Framework | Controls | OpenNETCF | Tutorials  | 
 Wednesday, January 03, 2007
Nach dem Stephan Oetzels Webseite zur Entwicklung mit dem Compact Framework wegen technischer Probleme offline war wird diese seite vorraussichtlich im Februar wieder online gehen.

Die Seite wird dann wieder unter :

   http://smartdevelopment.de/ erreichabr sein

1/3/2007 7:55:03 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | .NET Allgemein | Compact Framework  | 
 Wednesday, November 15, 2006
Jeder Entwickler steht beim Entwickeln einer PDA Software früher oder später vor der Frage , welche Datenbank er verwenden möchte.

Hat man nur kleine Prozessdaten so reicht XML aus. Fallen aber größere Datenmengen an, welche z.bsp. auch über eine Synchronisation kommen wird die Sache schon etwas schwieriger, insbesondere da XML auf PocketPC's und Smartphones nichts wirklich schnell ist.

Eine sehr gute integrierte Möglichkeit stellt der SQL Mobile 5.0 dar, welcher sogar über Replication services ein Synchronisationsmodul hat.Allerdings ist dieser nur solange kostenlos wie keine "echten" SQL Server im Spiel sind. S. :
http://www.microsoft.com/sql/editions/sqlmobile/howtobuy.mspx

Eine alternative insbesondere für OpenSource projekte könnte db40 sein. Von dieser datenbank gibts viele ableger u.a. auch für das Compact Framework s.:
http://www.db4o.com/s/compactframeworkdb.aspx
Db4o unterliegt der GPL was zur folge hat dass man die eigene Anwendung auch der GPL unterwerfen muss. Wer das nicht möchte kann allerdings auch hier eine kommerzielle Lizenz erwerben.

Angeblich soll aber sogar der Oracle lite unter dem ComapctFramework 2 laufen, dies konnte ich bsi jetzt aber leider noch nicht testen. Hat jemand dazu Erfahrungen?

Wenn ja würde es mich freuen wenn ihr mir was zu kommen lassen könntet, ich werde die informationen dann hier veröffentlichen

11/15/2006 8:01:22 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [8]    | .NET Allgemein | Compact Framework | Controls | SQL Mobile  | 
 Wednesday, September 27, 2006

Von Nargo habe ich gerade einen Hinweis auf folgenden Artikel erhalten:

http://www.golem.de/0609/48051.html

auf das Release bin ich schon gespannt.

Das .Net Microframework ziel auf embedded devices ab und soll angeblich unter 2MB RAM belegen.


Klingt also sehr viel versprechend!

9/27/2006 12:46:41 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [4]    | .NET Allgemein | Compact Framework  | 
 Tuesday, September 05, 2006

Gerade eben bin ich über ein weiteres Projekt gestolpert in dem OpenSource Projekte zu finden sind.

Das ganze ist unter : http://www.codeplex.com/ zu finden
Ausserdem habe ich es links in die Navigation aufgenommen
9/5/2006 10:58:51 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | .NET Allgemein | Compact Framework | Controls | Sonstiges & Offtopic | Updates & SP  | 
 Monday, September 04, 2006



Die Tage bin ich über einen Punkt in .Net / C# gestolpert bei dem ich mir denke dass es den ein oder anderen verwirren könnte
Also nehmen wir mal eine Klasse „Basis“

    class Basis
  
{
        public virtual string GetText()
       
{
            return "Basis";
        }
    }
 


und dazu noch eine Klasse die sich hiervon ableitet:

    class Child : Basis
   
{
        public override string GetText()
        {
            return "Child";
        }
    }
 

Nun hole ich mir die Objekte der Klassen

 

Basis oBasis = new Basis();

Child oChild = new Child;

 

 

oChild.GetText() liefert “Child” -> Logisch
oBasis.GetText() liefert “Basis” -> Logisch

((Basis) oChild).GetText() -> Liefert ebenfalls Child. Verstehtman auch gut, da ja immer noch das glecihe Objekt im speicher angesprochen wird.

 
Wenn ich mir nun aber eine Referenz in eine Variable mit dem Typ Basis nehem also so :

Basis Temp = oChild;

Dann Liefert Temp.GetText() ebenfalls Child.

Bei komplexeren Sourcecodes kann ich mir vorstellen dass das schenll mal zu problemen führt, da man bei einem flüchtigen Blick davon ausgeht dass Temp den  Basiscode ausführt.


9/4/2006 7:27:43 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | .NET Allgemein | Compact Framework  | 
 Thursday, August 31, 2006

Hi


da ich nun schon mehrfach danach gefragt wurde, wie man in die PocketPC programmierung mit dem CF 2.0 einsteigt werde ich in den nächsten 1,2 Wochen einen Webcast machen und hier online stellen, welcher demonstriert wie man zu einer Simplen PocketPC - Anwendung mit Daten anbindung kommt.

Da dies mein erster Versuch in dieser Richtung ist, bitte ich um Feedback und Rücksicht, falls da noch nicht alles optimal sein wird

8/31/2006 2:04:43 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [1]    | .NET Allgemein | Compact Framework  | 
 Tuesday, July 04, 2006

 

All the code tipps tricks and hints are providerer “As Is” and there are no garantuees that it works. You have to test ,evaluate and use these things at your own Risk!

 

Also think about that Storagecard don’t have unlimited write accesses!

 

When I started developping software for small devices like PocketPC’s the applications were first of all very small and the databasesize didn’t exceed 10 MB.

Also on WinCE4 devices there was plenty enough of space for the database.

 

Now with the time the application growed and WinMobile 5 appaered , the things changed.

First of all the Database size has grown dramatically also the aviable space for file storage (e.g. the T-Mobile MDA PRO) decreased.

On some devices t here was only 10MB space for Files left.
So I decided to put the Database on the storagecard. After the first run I thought “Great it works”.

 
But first of all some strange errors occured. For example an error said “The command needs an open and prepared connection” meanwhile in the same moment the state property of the connection said the database were open and ready.

 

Time after time I found out, that this problems only happen when the device were turned off or was in some kind of sleep state.
Therefore I found a nice class of the OpenNETCF (s. OpenNETCF.org) which gave me the abillity to react on the device open event.

So first of I all I bind the event like this:

 
DeviceManagement
.DeviceWake += new DeviceNotification(DeviceManagement_DeviceWake);

 

Then I add some code which reopens the SQL Connection. But attention! I experienced that the event doesn’t always fire IMMEDIATLY when the device is turned on and ofte n fire many times instead of exact one time per turn on!

 

So you have to handle that this mehtod aren’t going to run twice ore more times at once!

 

To Handle the multiple DeviceWake events I write back the DateTime of the DeviceWake events and I only execute code if some time (one second) has passed till the last Wakeevent.

I assume no one is quick enough to turn the PocketPC on and off again in one second...

 

/// <summary>

/// Time when the Devicewakeevent fired the last time

/// </summary>

DateTime LastWake = DateTime.Now;

 

/// <summary>

/// As long as an Wakeevent is in progress this flag is true!

/// </summary>

public bool lWakeInProgress = false;

 

 

      void DeviceManagement_DeviceWake()

        {

 

         //Gettin the Timespan till the last Wakeevent fired

  TimeSpan TimeLastWake = DateTime.Now.Subtract(this.LastWake);

           

 

//So if theres no other Wake in Progress and the last wake event was before one second or longer I run my wake code

            if (!this.lWakeInProgress && TimeLastWake.TotalSeconds > 1)

            {

               

                try

                {

                    //Setting a hint to see that a wake is in progress

                    this.lWakeInProgress = true;

 

                    //Showing the user that we do something

                    Program.SetCursor(true);

 

                    //Giving the OS the change to handle own events ( this seemed to be important du to incoming phone calls which could wake up the device)

                    Program.Sleep(2);

 

                    //Now look if the Database physically exists, if not..

                    if (!System.IO.File.Exists(Program.cDataBaseFile))

                    {

                        // We’ll waiit 2 Seconds ( after this I never had any problems of an missing database file

                        Program.Sleep(2);

                    }

 

                    //Now I call my code to reconnect to database (closing and reponing the conection)

                    Program.ReConnectToDataBase();

 

                    //Soll das Wake protokolliert werden?

                    if (Program.lLogWake)

                    {

                        Program.oLog.LogErr("DeviceWake()", "Wake beendet");

                    }

 

                    //Wieder aufbauen

                    Program.SetCursor(false);

 

                    this.lWakeInProgress = false;

                }

                catch

                {

                   

                }

                finally

                {

                    this.lWakeInProgress = false;

                }

 

                //Updating the LastWake event DateTime ...

   this.LastWake = DateTime.Now;

 

   //and resetting the hint that the wake is in progress

                this.lWakeInProgress = false;

            }

 

Some more hints:

-         Check that SQL Procedures triggered by timer or something similar have their on SQL Connection otherwise you could get some errors conecrning and “already in use “ error of the SQL Connection

 

-         Be aware of using the PowerDown event in combination with the DeviceWake event. Some times the order of these 2 Events are mixed up ! So the PowerDown fires after the DeviceWake.

 

-         The Code of the PowerDown event isn’T always execute before  the device is really off . Furthermore it seems like the code is put onto the stakc and executet when the device is turned on again

 

-         No code of your .NET Enviroment is beeing executed while de device is off ( no timmer, no events, etc...) But there are APIfunctions to set an wakeup time. For this s. s. Daniel Moth’s Blog

     -   All devices should have installed the Latest ROM and OS Version because they improved a lot of handling of internal storages !

So I hope this was some kind of help concerning database SQL Mobile on PocketPC’s with, .NET CF2.0 and Storagecards

 

It this was helpfull pls. Concider an paypal spent

7/4/2006 2:58:37 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | Compact Framework | OpenNETCF | SQL Mobile  | 
 Tuesday, June 13, 2006

Hi

das OpenNETCF 2.0 gibts nun in 2 Versionen.
Eine kostenlose und eine für 50$ zu lizensierende Version.

Der Entscheidende unterschied ist dass die Kostenlose keine Designer oder Intellisense unterstützung mehr hat.
Die Kostenpflichte Version unterstützt sowohl designer als auch Intellisense und bietet uach einige Tolls an die sich in die IDE integrieren.

Mehr infos dazu gibts auch unter :  <ctake/> -BLog

OpenNETCF scheint also immer mehr in die,  inzwischen fast übliche, Richtung zugehen von Ihren Produkten eine Standard und eine kostenlose abgespeckte Version zu gehen.

Falls daraus resultiert dass es noch bessere Controls gibt fände ich das gar nicht mal so schlecht, zu mal mir 50$ verkfraftbar erscheinen



Google Anzeige:
6/13/2006 7:37:39 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | Compact Framework | Controls | OpenNETCF | Updates & SP  | 
 Wednesday, June 07, 2006
Hi
Von OpenNETCF gibts eine neue kommerzielle Bibliothek, welche Kalenderansichten auf dem PocketPC im Outlook style ermöglicht.

Hier ein Bild:


Weitere Infos unter:

http://www.opennetcf.com/controls/calendar


6/7/2006 11:59:41 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | .NET Allgemein | Compact Framework | Controls | GUI | OpenNETCF | Updates & SP  | 
 Thursday, May 04, 2006

Da ich momentan ja mit Errors zu tun habe, welche innerhalb von ThirdPartyTools auftreten und TryCatch Funktionalität nicht greift, habe ich nach einem Weg gesucht alle nicht abgefangenen Fehler zu Catch.

Die Lösung dafür gibts in Daniel Moth BLog:
http://www.danielmoth.com/Blog/2004/12/appdomainunhandledexception-part-1.html

Somit habe ich eine Globale Möglichkeit immer auf Fehler reagieren zu können, selbst wenn sie nicht gehandelt sind.
5/4/2006 12:37:03 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [5]    | .NET Allgemein | Compact Framework  | 
 Wednesday, May 03, 2006

Da die Frage aufkam wie man Sounds im .NET CompactFramework abspielen kann hier ein kurzer Artikel für alle dazu.

Der nachfolgende Code baut auf einem Sample auf den ich Im Netz fand und bis jetzt funktioniert alles einwandfrei und einfach.


Erstmal machen wir uns eine "SoundKlasse":


using System;

using System.Collections.Generic;

using System.Text;

using System.IO;

using System.Runtime.InteropServices;

 

namespace BETools

{

    public class Sound

    {

        /// <summary>

        /// Letzter aufgetretener FEhler

        /// </summary>

        public Exception LastErr=null;

 

        /// <summary>

        /// Sound stream zum abspielen. DAtei hat aber prio

        /// </summary>

        private byte[] m_soundBytes;

 

        /// <summary>

        /// Dateiname des sounds

        /// </summary>

        private string m_fileName;

 

        /// <summary>

        /// Flags

        /// </summary>

        private enum Flags

        {

            SND_SYNC = 0x0000,  /* play synchronously (default) */

            SND_ASYNC = 0x0001,  /* play asynchronously */

            SND_NODEFAULT = 0x0002,  /* silence (!default) if sound not found */

            SND_MEMORY = 0x0004,  /* pszSound points to a memory file */

            SND_LOOP = 0x0008,  /* loop the sound until next sndPlaySound */

            SND_NOSTOP = 0x0010,  /* don't stop any currently playing sound */

            SND_NOWAIT = 0x00002000, /* don't wait if the driver is busy */

            SND_ALIAS = 0x00010000, /* name is a registry alias */

            SND_ALIAS_ID = 0x00110000, /* alias is a predefined ID */

            SND_FILENAME = 0x00020000, /* name is file name */

            SND_RESOURCE = 0x00040004  /* name is resource name or atom */

        }

 

        /// <summary>

        /// PLaysound file DLL Aufruf

        /// </summary>

        /// <param name="szSound">Filename</param>

        /// <param name="hMod">NullPointer</param>

        /// <param name="flags">Flags.s.o.</param>

        /// <returns></returns>

        [DllImport("CoreDll.DLL", EntryPoint = "PlaySound", SetLastError = true)]

        private extern static int WCE_PlaySound(string szSound, IntPtr hMod, int flags);

 

        /// <summary>

        /// PLay Soundstream DLL Aufruf

        /// </summary>

        /// <param name="szSound">Stream</param>

        /// <param name="hMod">NullPointer</param>

        /// <param name="flags">Flags.s.o.</param>

        /// <returns></returns>

        [DllImport("CoreDll.DLL", EntryPoint = "PlaySound", SetLastError = true)]

        private extern static int WCE_PlaySoundBytes(byte[] szSound, IntPtr hMod, int flags);

 

        /// <summary>

        /// Übergeben des Filenames beim init, des soundfiles das abgespielt werden soll

        /// </summary>

        public Sound(string fileName)

        {

            m_fileName = fileName;

        }

 

        /// <summary>

        /// Soundstream der beim initübergeben wird, der später abgesproelt werden soll

        /// </summary>

        public Sound(Stream stream)

        {

            // read the data from the stream

            m_soundBytes = new byte[stream.Length];

            stream.Read(m_soundBytes, 0, (int)stream.Length);

        }

 

        /// <summary>

        /// Abspielen des Sounds

        /// </summary>

        public void Play()

        {

 

            //Wir prüfen ob ein Stream oder Filename abgespielt werden soll

            try

            {

                if (m_fileName != null)

                    WCE_PlaySound(m_fileName, IntPtr.Zero, (int)(Flags.SND_ASYNC | Flags.SND_FILENAME));

                else

                    WCE_PlaySoundBytes(m_soundBytes, IntPtr.Zero, (int)(Flags.SND_ASYNC | Flags.SND_MEMORY));

            }

            catch(Exception Err)

            {

                this.LastErr = Err;

            }

        }

    }

}

 


Nun Rufen wir nur noch die Soundklasse auf und spielen den Sound ab, das geht so :
string lcSoundFIle = @"\\meinsound.wav";

//Sound objekt erstellen

Sound oSound = new Sound(lcDateiName);              

oSound.Play();




Wenn dieser Beitrag hilfreich war würde ich mich über eine Spende freuen:
5/3/2006 9:14:40 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [1]   Compact Framework | Controls  | 
 Tuesday, May 02, 2006

Bei dem DeviceManagement des OpenNetCF habe ich einen Bug festgestellt.
Dieser tritt auf, wenn man das DeviceWake event bindet und folgende Schritte tut:


- Anwendung starten
- Device Binden
- Andere Anwendung öffnen und in den Vordergrund holen
- PPC für einige Zeit ausschalten und dann nach einer Weile wieder einschalten.

Es folgt ein Object disposed error.

ctake  hat den Bug behoben und soll im nächsten Release drin sein.

Nochmal vielen Dank anihn für das schnelle Bugfix! :)
5/2/2006 12:30:54 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Compact Framework | Controls | Updates & SP | OpenNETCF  | 
 Friday, April 28, 2006




Das .NET CF2 SP1 wurde angekündigt.
Die Infos dazu gibts auf der offiziellen .NET CF Team Seite.

Sehr interessant ist dass nun auch WinCE 4.2 Devices Unterstützt werden.
Allerdings gibt mir folgender Satz noch zu denken :

Installer should check for ActiveSync version and disable deployment if prior to AS 4.0 build 4343.

Bedeutet das nun dass man ActiveSync 4.0 braucht um .NET CF Anwendungen via CeAppMgr. zu installieren?
Das ist insofern grausam las dass AS 4.0 in Kombination mit nicht WM5 Devices einige Bugs hat.
Zbsp. dass Word dokumente in das WM5 Word format konvertiert werden und so nicht mehr auf dem PPC geöffnet werden können---


Das Datagrid wird auch verbessert, infos hierzu befinden sich unter http://blogs.msdn.com/netcfteam/archive/2006/04/25/583542.aspx

Zitat "Compact framework V2 Service Pack 1 introduces minor, but very useful extensions to address these issues either directly (e.g. data formatting) or by allowing customer to perform custom cell drawings to achieve desired results."
4/28/2006 8:16:28 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | Compact Framework | Updates & SP  | 
 Tuesday, April 25, 2006

Nun da ich endlich mit der Umstellung von .NET CF1 auf CF 2.0 fertig bin, muss ich sagen, dass das ganze sich schwieriger gestaltete als man es irgendwo hätte lesen können.

Keine Thirdparty controls liefen mehr, auch deren Portierung läuft zur Stunde noch, Forms einfach konvertieren klappt auch nur in den seltesten Fällen usw.

Aber das .NET CF 2.0 bringt auch einige neue Features die inzwischen zu einem "Must-Have" geworden sind.
Hier mal eine Liste meiner persönlichen Favoriten:
- Anchoring
- SQL Mobile 3.0 Welcher via SQL Server Management Studio angesprochen werden kann.
- Einbindung der PocketPC Tasten
- Notifications.
- using () anweisung

Auf all diese Features möchte ich schon alleine wegen der neuen WinMobile geräte mit Querydisplay gar nicht mehr vermissen.

Auch stieg die Performance mit dem SQL Mobile 3 deutlich.
Gerade die using() anweisung zum Begrenzen der Lebenszeit von einigen Objekten hatte auf WindowsMobile5 geräten mit einem eh knappen RAM große Vorteile gebracht.

Hat jemand ähnliche oder andere Erfahrungen gemacht?
4/25/2006 7:42:25 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [2]    | Compact Framework | SQL Mobile  | 
 Thursday, April 20, 2006


Gerade bei Anwendungen auf den kleinen Geräten ist es wichtig darauf zu achten, möglichst performante Algorithmen zu haben, welche Zentral liegen.
Der Nachfolgende Text zeit eine Möglichkeit hierzu. Das ganze lässt sich auch analog im "normalen" .NET Framework realisieren.

Ein gut strukturierter Aufbau der Klassen, sowie ein Zentrales Datenhandling kommt da schon sehr entgegen.
Aufgrund einiger Optimierungen konnte ich eine PDA Anwendung um 75% beschleunigen und dabei den RAM Verbrauch sogar halbieren.

Eine Strategie davon ist der sinnvolle Einsatz von Hashtables.

Hashtables sind "Arrayähnliche" Objekte in welchen man über einen Objectkey Werte ablegen kann.
Z.bsp. so :

[code]
Hastable htWerte = new Hastable();
htWerte.Add("MeinKey","MeinWert");
[/code]

Da eine Hashtable sowohl für die Keys als auch für den Wert Objects erwartetm kann ich auch andere Typen als String hinterlegen und das sogar gemischt.

bsp:

DateTime ldDatum = DateTime.Now;
htGeburtsTage.Add(ldDatum,"heutiger Geburtstag");

Abrufen kann man die Werte über den Key z.bsp. so:
DateTime Gebtag = (DateTime) htGeburtsTage[DateTime.Now];

Was das ganze der Performance birngt ist klar.
Nehmen wir mal an wir haben eine Zentrale Methode welches aus dem Primary Key aus einer Tabelle mit Benutzern, den Namen des jeweiligen USers zurück liefert.
So ist doch die Abfrage ob wir hierfür jedes mal explizit ein SQL Conneciton brauchen.

Viel mehr wäre folgendes performanter:

Hastable htNamen = new Hashtable();
public string Id2Name(int tnId)
{
    string lcName;
   
    //Nachsehen ob der Wert schon gecached wurde
    if(this.htNamen.ContainsKey(lcName))
    {
        //Wert steht in der Hashtable => Direkt hieraus übernehmen
        lcName = (string) this.htNamen[tnId];
    }
    else
    {

         // Wert noch nciht vorhanden => Selektierne und danach für zukünftige Anfragen cachen
         lcName = oDaten.Id2Name(tnID);
         this.htNamen.Add(tnID,lcName);
    }


    return lcName
}


Das dies Performance bringt erklärt sich fast von selbst. Die Daten liegen im RAM vor und gerade bei neuen PocketPC 's welche einen langsamen ROM nutzen ist der Unterschied deutlich fühl- und messbar. Bei Desktopanwendungen wird zudem auch noch das Netzwerk weniger belastet und einige Selects können durch das einsparen von joins vereinfacht werden.

So wirkt sich der Vorteil auf sämtliche Clients aus.
4/20/2006 11:32:45 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [4]   .NET Allgemein | Compact Framework | SQL Mobile  | 
 Thursday, April 06, 2006



Am 3. Mittwoch im Mai startet der von mir geleitetet .NET (Compact) Framework Stammtisch.
Der erste Stammtisch wird im Rahmen des DFPUG Stammtischs Speyer stattfinden. Dort wird man Besprechen, wann und wo es weiter geht.

Die ersten Sessions werden wir damit beginnen, anhand einer kleinen Beispielanwendung, die Erstellung einer PocketPC Anwendung durchzugehen wird.

Währen der Entwicklung werden wir wohl auf einige Eigenheiten des CF stoßen und diese dann gleich Vorort durchdiskutieren und lösen.

Ich hoffe auf möglichst viele Interessierte.

Über Feedback und Wünsche freue ich mich!

In den nächsten Tagen werde ich das Beispiel, einer Indexbasierten Suche auf dem SQL Mobile / SQLCE hier noch eintragen und zur Verfügung stellen.
4/6/2006 2:39:19 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [2]    | .NET Allgemein | Compact Framework | SQL Mobile  | 
 Thursday, March 09, 2006



So mein letztes BLog posting ist schon eine ganze Weile her, da überall viel zu erledigen war. Nun habe ich aber einen kleinen Augenblick gefunden um die CompactFramework (.NET Framework für PDA) Section etwas füllen z

Meine Heimatsprache liegt ja eigentlich in VFP insofern bin ich es gewohnt viele schnelle Datenbankoperationen direkt in meiner Entwicklungsumgebung zu haben. Wie Z.bsp. ein LookUp() oder der Seek()

In .NET speziell im Compact Framework gibt es auch eine ganze Reihe von Möglichkeiten, welche aber nicht so einfach zur Verfügung stehen.
Im Rahmen eines Imports benötigte ich jedoch eine Methode, welche es ermöglicht so schnell wie möglich feststellen zu können ob ein Datensatz bereits existiert, diese wird auch Mehrfach hinterinander aufgerufen.


Deswegen habe ich versucht 2 Methoden zu implementeieren welche den VFP SEEK() und LOOKUP sehr nahe kommen. Hierzu habe insbesodnere in den Newsgroups anleitung gefunden.
Diese Methode läuft sowohl mit SQLCe also auch dem SQL Mobile 3.0

///

/// SqlCeCommand Objekt für die Seek und lookup methode

///

SqlCeCommand Seekcmd;

 

///

/// SQlCEDataReader für Lookup() und Seek

///

SqlCeDataReader rdr;

 

///

/// Prüft auf einem Indes ob die angebene ID in dem Index Felder der angegebenen Tabelle existiert

///

///

Tabelle in der gesucht wird

///

ID nach der gesucht wird

///

Indiziertes Feld in dem gesucht wird, ohne Index -> Exception

/// bool ob gefunden

public bool Seek(string tcTable, string tcID, string tcIndexField)

{

// BaseTable Search = VFP indexbased Seek() Like Suche

bool llFound = false;

 

// Wir suchen auf der angebenen Tabelle

Seekcmd.CommandText = tcTable;

 

// und dem angebenen Index

Seekcmd.IndexName = tcIndexField;

 

// Die Range gibt an für welchen Bereich espäter ein Reader erzeugt werden soll.

// In unserem Fall eben genau dieser eine Wert. Ein Reader hat den Vortiel dass wir nicht erst selektieren

// müssen sondern uns einfach direkt auf den Zielsatz setzen werden.

Seekcmd.SetRange(DbRangeOptions.Match , new object[] { tcID }, null);

 

// wir erzeugen uns aus TableName,Index und Range einen Reader

using (this.rdr = Seekcmd.ExecuteReader())

{

 

//// Prüfen ob wir einen Reader erzeugen konnten.

if (this.rdr != null && !this.rdr.IsClosed && this.rdr.HasRows)

{

 

//Wenn nun das erste lesen klappt haben wir einen satz gefunden!

if (rdr.Read())

{

llFound = true;

}

 

}

 

// Reader schliesen

this.rdr.Close();

}

return llFound;

}

War dieser Eintrag hilfreich ? Wenn ja würde ich mich über eine kleine Spende freuen:

3/9/2006 3:31:46 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]    | Compact Framework | SQL Mobile  | 
Copyright © 2010 Haggy. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: