Tuesday, August 08, 2006

Icons

Today I am going to try and hunt for nice icons for my project at work.

Neat Tool.
http://www.rw-designer.com/batch-icon-extractor

Writing your own custom control!
http://www.codeproject.com/cs/miscctrl/cutebutton.asp

Monday, August 07, 2006

Links of the day

There is no such thing as magic. Excellent series on anonymous methods.
http://blogs.msdn.com/oldnewthing/archive/2006/08/02/686456.aspx
http://blogs.msdn.com/oldnewthing/archive/2006/08/03/687529.aspx
http://blogs.msdn.com/oldnewthing/archive/2006/08/04/688527.aspx
http://blogs.msdn.com/oldnewthing/archive/2006/08/07/690947.aspx

How to read resource files:
Create a resx file and embed it in assembly or use linker to create new dll. Point to that assembly or file, and use it like a key value pair. Useful for localized support.
http://www.codeproject.com/csharp/cs-multi-assembly-res.asp
http://www.codeproject.com/csharp/multilingual_pplication.asp

List of Language and Country Codes
http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

Friday, August 04, 2006

OdbcCommand vs OleDBCommand

Something interesting that was discovered lately. When running stored procedures between Odbc and OleDB via the .NET 1.1 Command objects, there are incompatibilities.

So given this code snippet...
/*Works for Odbc*/
OdbcCommand cmd = new OdbcCommand(connString);
cmd.Text = "exec sp_help ?";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Table",tableName);
OdbcDataAdapter adapt = new OdbcDataAdapter(cmd);
adapt.Fill(dataSet);
the execution will go through succesfully.
However, if you change OdbcCommand to OleDbCommand, the snippet will fail.

This will work for OleDb but not Odbc, and is often the way I had used it for SqlCommand.
cmd.Text = "sp_help";
cmd.CommandType = CommandType.StoredProcedure;

And this will work for both Odbc and OleDb but I have not tested against SqlCommand.
/*Works for Both*/
cmd.Text = "{call sp_help ?}";
cmd.CommandType = CommandType.Text;

Later on I'll create a test project that will test all 3 Command objects.