Home ::  Admin

chris carter's web log

Being Sick Sucks

8:54 PM Sunday Nov 26, 2006 Comments: 0

I've been sick for almost a week now. I hate being sick. I had grand plans of staying home from work and then getting all those other projects done while I was resting. Ya, that plan totally flopped and I actually had to rest, the non-computing kind. What a drag. Best of all I still feel like crap...grrr...here's a couple of things I've seen while resting of interest(to me):

Looks like FlameRobin go a new release, and is now 100 percent compatible wth Firebird 2.0.

Scriptaculous has a 1.7 beta out that includes some wicked cool morphing effects built on top of Prototype 1.5.0_rc2 that contains some bug fixes.  Check out the morphing demos here.

Lollygag AJAX framework.  I guess it's worth trying out(that name is so annoyingly stupid that it might keep me from trying).

FirebirdSql: Round Two

7:53 PM Sunday Nov 19, 2006 Comments: 0

My first crack at a ui for FirebirdSql was very pleasing. Flamerobin is a great ui for interacting with a Firebird SQL database.  Flamerobin has intellisense that's pretty intuitive.  I haven't used it much but from my initial bout of use today, it's pretty handy.  The intellisense is populated with key words as well as database objects.  Very cool.

FirebirdSql: Round One

8:17 AM Sunday Nov 19, 2006 Comments: 0

FirebirdSql is great little database engine with a dot net data provider. I just got it up and running along with a little sample connection app to test connectivity from dot net. So far so good, no hiccups, it installed without hassle, and I connected the first time out with no probs, that's good software.

Here is the sample app to connect to the FirebirdSql employee database that is installed by default:

using System;
using System.Data;
using FirebirdSql.Data.FirebirdClient;

public class Driver{
  public static void Main(string[] args){
  try{
    Driver driver = new Driver();
    driver.Run();
    }catch(Exception ex){
    Console.WriteLine(ex.ToString());
    }
  }
  public void Run(){
    string connectionString = 
      @"server=localhost;user=SYSDBA;password=monkeyboy;database=" +
      @"c:\program files\firebird\firebird_2_0\examples\empbuild\employee.fdb;";
    string commandText = "select * from employee;";
    DataTable data = new DataTable();
    using (FbConnection cn = new FbConnection(connectionString))
    using (FbDataAdapter da = new FbDataAdapter(commandText, cn)){
      da.Fill(data);
    }
    foreach(DataRow row in data.Rows){
      for(int i=0;i<data.Columns.Count;i++){
        if(i>0) Console.Write(", ");
        Console.Write(row[i].ToString());
      }   
    }
  }
}

Download the sample code here: firebird-round-one.zip(3K)

FileHelpers

7:15 PM Saturday Nov 18, 2006 Comments: 0

FileHelpers is a way cool tool that makes reading and writing to text files very simple.  I don't know how many times I've written some form of a csv reader and/or writer, but this would have saved some time.  Here is a simple example that is based on a codeproject article.

Assuming we have a pipe(|) delimited file of customers like this:

1|Chris Carter
2|Riley Carter
3|Anja Carter
4|Emmitt Carter

We could write a class to read each line as a strongly typed Customer object like this:

using System;
using FileHelpers;

public class Driver{
  public static void Main(string[] args){
    try{
      Driver driver = new Driver();
      driver.Run();
    }catch(Exception ex){
      Console.WriteLine(ex.ToString());
    }
    Console.WriteLine("Done...");
    Console.ReadLine();
  }
  public void Run(){
    FileHelperEngine engine = new FileHelperEngine(typeof(Customer));
    Customer[] customers = engine.ReadFile("customers.dat") as Customer[];
    foreach(Customer customer in customers){
      Console.WriteLine("{0}. {1}", customer.ID, customer.Name);
    }
  }
}

[DelimitedRecord("|")]
public class Customer{
  public int ID;
  public string Name;
}

Download the example - filehelpers-example.zip(44KB)

ASP.NET AJAX Post on AjaxRocks.com!

9:17 PM Wednesday Nov 1, 2006 Comments: 0

Hello World exampled posted on AjaxRocks.com on ASP.NET AJAX, formerly ATLAS.