Monday, March 8, 2010

Application/AppDirectory Path WPF

Full exe path
System.Reflection.Assembly.GetExecutingAssembly().Location

Directory from exe file executed
AppDomain.CurrentDomain.BaseDirectory

Tuesday, March 2, 2010

Change label color programmatically in WPF

Rather than System.Drawing.Color enum
use System.Windows.Media.Brushes

Me.lblDentist.Foreground = Brushes.Blue

Exit a WPF application

Application.Current.Shutdown()

Wednesday, February 3, 2010

Change database collation

--script to change database collation - James Agnini
--
--Replace with the database name
--Replace with the collation, eg SQL_Latin1_General_CP1_CI_AS
--
--After running this script, run the script to rebuild all indexes
ALTER DATABASE COLLATE

PlatformNotSupportedException Pocket PC

PlatformNotSupportedException when connecting from Pocket PC to a SQL Server Database.
>> If i try to connect to SQL Server with default collation
>> (i.e. SQL_Latin1_General_CP1_Cl_AS) then SqlClient is working fine and everything is fine.
>> Arif

Wednesday, January 27, 2010