December 13, 2005

A Very Brief Peek at LINQ

t PDC, Microsoft announced the Language Integrated Query framework (the LINQ Project). The LINQ Project is a set of language extensions to C# and Visual Basic and a unified programming model that extends the .NET Framework to offer integrated querying for objects, databases, and XML. You can query against any

Use sun.misc Classes for Base64 Image Conversion

The following code demonstrates how to use sun.misc classes for Base64 image conversion: import java.io.*;import java.awt.*;import java.awt.event.*;class Base64Example extends Frame implements ActionListener{Image IMG=null; //image1Image IMGdecode=null; //image2-resultTextArea TA=new TextArea(); //printing the Base64 formButton B=new Button(“Decoder”);byte[] buffer_code=new byte[1024];byte[] buffer_decode;boolean bool=false;//constructorulpublic Base64Example(String titlu) { super(titlu); }void init() { Dimension dim=Toolkit.getDefaultToolkit().getScreenSize(); setSize(550,460); setLocation(dim.width/2-275,dim.height/2-280); setLayout(null);

Implement GetTickCount in Linux

To implement the GetTickCount API when porting code from Windows to Linux, use the following code: long getTickCount(){ tms tm; return times(&tm);}

How to Hide a ContextMenu

To display the shortcut menu, you call ContextMenu.Show() method. Typically, you call this method if the right mouse button on a control or area of the form is clicked. The following snippet demonstrates this: private void myControl_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e){ if (e.Button == MouseButtons.Right) myControl.ContextMenu.Show(myControl, new Point(e.X, e.Y) ); }

Handling Null Values in Oracle

Oftentimes, a query will return null values for some of the columns in a query. However, to display “null” as the value in the generated report isn’t a very effective way to display this information. Oracle provides an easy solution for this problem. For example, suppose you are generating a

Streamline your Data Connections by Moving to MARS

ultiple Active Result Sets (MARS) is a new feature of ADO.NET 2.0 that allows multiple queries or stored procedures to be performed on a single connection. The result of this is that you can get and manage multiple, forward-only, read-only result sets on a single connection. Prior to MARS, each