Sven's profileWebSmitSpacePhotosBlogListsMore Tools Help

Blog


    November 20

    Newline and RichTextBox in VB.NET

    Problem

    Today, I had several problems while using a RichTextBox for Application Logging with EntLib and the new Custom TextBoxListener capabilities. (Output is logging to a TextBox of my main form.) But the problem was that I just replaced TextBox with RichTextBox and the formatting didn't display properly.

    Solution

    Just replace the .Text Property with the .AppendText method of RichtTextBox, found here.

    Julian Day Format in VB.NET

    It's just that simple:

    Private Function GetJulianDay() As String

        Return Now.ToString("yy") & Now.DayOfYear.ToString("000")
    End Function

    Vista Blue Screen: “Your BIOS is not fully ACPI compliant“

    Today I found this very strange error message while booting my system. I already installed the actual BIOS for my motherboard, a Gigabyte GA-M55-S3 v2.0. I remembered that Vista installed several updates (46) when I left the office yesterday. That must be the cause of the problem! While talking to my colleague we found the solution, it has something to do with DMI. I never thought about what DMI is and what it does. Nevertheless the Gigabyte BIOS has a tiny tool called "Flash utility" (or similar), you can reach while pressing the "End" key when the system boots. There is an option for "Keep DMI Data", this was set to "Enable" – I turned it to "Disable" and then the system booted fine.

    Regards

    Sven

    September 29

    Siemens protocol 3964R in C#

    HOWTO:

    Did you ever look for a free implementation of the serial communications protocol 3964R? I found a solution. There is a free project called "rkjava" available on the web. Please have a look at www.rkjava.de. I tried converting this Java solution to C# and – surprise – it was successful. Communication now works very well and imagine – you saved several hundred Euros.

    The best feature: it's completely implemented in managed code – no P/Invoke and no ActiveX. By now I only know of the Adontec package based on ActiveX.

     

    Tags: PLC-access via serial interface, Siemens Moby-I, VB.NET, C#, 3964 R

    May 09

    my Linkpage on del.icio.us

    Do you know del.icio.us? Good!
     
    This is my linkpage: http://del.icio.us/websmitty
     
     
    May 04

    WPF: Bind Infragistics xamDataGrid to DataSet using Oracle.DataAccess

    Recently, I tried the first steps with Avalon (WPF). Since I used already the great Infragistics NetAdvantage toolset, I liked to test their new UI Suite "NetAdvantage for WPF" v2007.1. While Data Binding in .NET 3.0 changed, at first I wasn't very successful in binding a DataSet to the xamDataGrid. Finally, I came to the following conclusion:

     

      public void Clicked(object sender, RoutedEventArgs e)
      {
          //some Code for opening Database-Connection
          openOracleConnection();
          OracleDataAdapter da = new OracleDataAdapter("SELECT * FROM myTable", myConn);
          DataSet ds = new DataSet();
          da.Fill(ds, "Table1");
          DataTable table = ds.Tables["Table1"];
          Binding bind = new Binding();
          this.dataGrid1.DataContext = table;
          bind.Source = table;
          this.dataGrid1.SetBinding(Infragistics.Windows.DataPresenter.XamDataGrid.DataSourceProperty, bind);
      }
     

    See Result in attached Image.

    I'm using Expression Blend 1.0 and VS2005 with the .Net Framework 3.0 Tools for WPF Nov. 2006 CTP, DataAccess is done through ODP.NET 10g R2 (Oracle.DataAccess.dll).

    Have fun!

    November 30

    Problem: SNTP Timesvc not updating System Time of Device

    Recently, I spent several hours (even days) in configuring the CE embedded SNTP Client to sync with a NTP Time Server. It *never* worked. I have the following entries in registry:

    [HKEY_LOCAL_MACHINE\Services\TIMESVC]
    "threshold"=dword:0007a120
    "recoveryrefresh"=dword:000493e0
    "refresh"=dword:05265c00
    "Server"="192.168.100.75"
    "Clientonly"=dword:00000001
    "ServerRole"=dword:00000000
    "Trustlocalclock"=dword:00000000
    "Order"=dword:00000063
    "Dll"="timesvc.dll"
    "Context"=dword:00000000
    "Keep"=dword:00000001
    "Prefix"="NTP"
    "Index"=dword:00000000
    "AutoUpdate"=dword:00000001

    And now, the solution: Look at the small Parameter "AutoUpdate", it should be set to "1" ! That's the clue I've found out. I searched MSDN documentation up and down and this parameter, the most important, is never mentioned.

    Sven

    November 15

    ..neverending story part II

    Hehe, as you wouldn't think, and I either that a reinstall could help me -> it did so. I am really able again to open my solution and edit my project. *very great*

    I had a little problem with a native C++ project but I excluded it from my solution because there is no need any more for this project.

    Btw.. if you know VNC and you are looking for real nice tool for your mobile device, the you have to look at this URL. This is VNC for mobile devices in native C++, the full source code - imagine!

    Until soon...

    Device Platform not found .. neverending story

    Yesterday, I had a serious problem while opening one of my solutions in Visual Studio 2005 for my actual project.
    There were very ugly error messages, for instance
     
    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    Error retrieving information from user datastore. Platform not found.
    ---------------------------
    OK
    ---------------------------
     
    Or
     
    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    The project could not be opened because it refers to a device platform that does not exist in your datastore.
    ---------------------------
    OK   Cancel
    ---------------------------
     

    I found while searching Google this blog entry from Daniel Moth facing nearly the same problem.

    But the solution didn't work for me.

    Already tried to talk to Mircosoft yesterday, because we're MSDN subscriber didn't solve anything, just wasting my time.
     
    I just tried to remove and reinstall VS2005.. let's see what happens..