Tuesday, April 21, 2009

How to get table structure via SQL?

MS SQL:

SELECT table_name,ordinal_position,column_name,data_type,  is_nullable,character_maximum_length FROM
information_schema.COLUMNS WHERE table_name LIKE '%TABLENAME%'
ORDER BY ordinal_position


or 

EXEC sp_help

MY SQL

SELECT column_name,column_type,is_nullable,column_key,col  umn_default,extra FROM information_schema.COLUMNSWHERE 
table_schema='' AND table_name=''


or

DESCRIBE ;

Wednesday, April 15, 2009

Add Vista Look to your WPF Control on Windows XP

Explains how to convert a XP looking UI into Vista look using WPF running under Window XP

Vista had come with new and cool look & feel. If you want to add the Vista Aero style theme to you WPF application running on Window XP then it is very easy trick. You don’t need any third party library or tool to achieve this.

To do this all you need to do is to add following lines of xaml code into the designer of your window right after window tag:

<ResourceDictionary Source="/PresentationFramework.Aero,     Version=3.0.0.0, Culture=neutral,     PublicKeyToken=31bf3856ad364e35,     ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
(OR)
<ResourceDictionary Source="/PresentationFramework.Aero;component/themes/aero.normalcolor.xaml" />

If you want to apply this look through out the application then add this to app.xaml under section.

Before Aero Theme

xp_default_theme

After Aero Theme

vista_aero_theme

The limitation of this technique is that it don't change the look of container form. You can see it still looks like a normal XP form.