December 21, 2009

Collapsible ListViewGroup

Making the ListViewGroup Collaps is not that hard. I've made an simple article on CodeProject.com. check it out here

December 9, 2009

CLR Datatype Mapping tables

SQL CLR Data type mapping
SQL Server data typeCLR data type (SQL Server)CLR data type (.NET Framework)
bigintSqlInt64Int64, Nullable<Int64>
binarySqlBytes, SqlBinaryByte[]
bitSqlBooleanBoolean, Nullable<Boolean>
charNoneNone
cursorNoneNone
dateSqlDateTimeDateTime, Nullable<DateTime>
datetimeSqlDateTimeDateTime, Nullable<DateTime>
datetime2SqlDateTimeDateTime, Nullable<DateTime>
DATETIMEOFFSETNoneDateTimeOffset, Nullable<DateTimeOffset>
decimalSqlDecimalDecimal, Nullable<Decimal>
floatSqlDoubleDouble, Nullable<Double>
geographySqlGeography
defined in Microsoft.SqlServer.Types.dll Download here:feature pack.
None
geometrySqlGeometry
defined in Microsoft.SqlServer.Types.dll Download here: feature pack.
None
hierarchyidSqlHierarchyId
defined in Microsoft.SqlServer.Types.dll Download here: feature pack.
None
imageNoneNone
intSqlInt32Int32, Nullable<Int32>
moneySqlMoneyDecimal, Nullable<Decimal>
ncharSqlChars, SqlStringString, Char[]
ntextNoneNone
numericSqlDecimalDecimal, Nullable<Decimal>
nvarcharSqlChars, SqlString
SQLChars is a better match for
data transfer and access, and
SQLString is a better match for
performing String operations.
String, Char[]
nvarchar(1), nchar(1)SqlChars, SqlStringChar, String, Char[], Nullable<char>
realSqlSingleSingle, Nullable<Single>
rowversionNoneByte[]
smallintSqlInt16Int16, Nullable<Int16>
smallmoneySqlMoneyDecimal, Nullable<Decimal>
sql_variantNoneObject
tableNoneNone
textNoneNone
timeTimeSpanTimeSpan, Nullable<TimeSpan>
timestampNoneNone
tinyintSqlByteByte, Nullable<Byte>
uniqueidentifierSqlGuidGuid, Nullable<Guid>
User-defined type(UDT)NoneThe same class that is bound
to the user-defined type in
the same assembly or a
dependent assembly.
varbinary SqlBytes, SqlBinaryByte[]
varbinary(1), binary(1)SqlBytes, SqlBinarybyte, Byte[], Nullable<byte>
varcharNoneNone
xmlSqlXmlNone
Source: http://msdn.microsoft.com/en-us/library/ms131092.aspx




Image Source: http://msdn.microsoft.com/en-us/library/bb386947.aspx



Platform Invoke Data Types
Unmanaged type in Wtypes.h Unmanaged C language typeManaged class nameDescription
HANDLEvoid*System.IntPtr32 bits
BYTEunsigned charSystem.Byte8 bits
SHORTshortSystem.Int1616 bits
WORDunsigned shortSystem.UInt1616 bits
INTintSystem.Int3232 bits
UINTunsigned intSystem.UInt3232 bits
LONGlongSystem.Int3232 bits
BOOLlongSystem.Int3232 bits
DWORDunsigned longSystem.UInt3232 bits
ULONGunsigned longSystem.UInt3232 bits
CHARcharSystem.CharDecorate with ANSI.
LPSTRchar*System.String or System.StringBuilderDecorate with ANSI.
LPCSTRConst char*System.String or System.StringBuilderDecorate with ANSI.
LPWSTRwchar_t*System.String or System.StringBuilderDecorate with Unicode.
LPCWSTRConst wchar_t*System.String or System.StringBuilderDecorate with Unicode.
FLOATFloatSystem.Single32 bits
DOUBLEDoubleSystem.Double64 bits

Source: http://msdn.microsoft.com/en-us/library/aa720411(VS.71).aspx



Multiple Data Types Mapping Table
CategoryClass nameDescriptionVisual Basic data typeC# data typeManaged Extensions for C++ data typeJScript data type
IntegerByteAn 8-bit unsigned integer.BytebytecharByte
SByteAn 8-bit signed integer.Not CLS-compliant.SByte No built-in type.sbytesigned charSByte
Int16A 16-bit signed integer.Shortshortshortshort
Int32A 32-bit signed integer.Integerintint -or- longint
Int64A 64-bit signed integer.Longlong__int64long
UInt16A 16-bit unsigned integer.Not CLS-compliant.UInt16 No built-in type.ushortunsigned shortUInt16
UInt32A 32-bit unsigned integer.Not CLS-compliant.UInt32 No built-in type.uintunsigned int -or- unsigned longUInt32
UInt64A 64-bit unsigned integer.Not CLS-compliant.UInt64 No built-in type.ulongunsigned __int64UInt64
Floating pointSingleA single-precision (32-bit) floating-point number.Singlefloatfloatfloat
DoubleA double-precision (64-bit) floating-point number.Doubledoubledoubledouble
LogicalBooleanA Boolean value (true or false).Booleanboolboolbool
OtherCharA Unicode (16-bit) character.Charcharwchar_tchar
DecimalA 96-bit decimal value.DecimaldecimalDecimalDecimal
IntPtrA signed integer whose size
depends on the underlying platform
(a 32-bit value on a 32-bit platform
and a 64-bit value on a 64-bit platform).
IntPtr No built-in type.IntPtr No built-in type.IntPtr No built-in type.IntPtr
UIntPtrAn unsigned integer whose size
depends on the underlying platform
(a 32- bit value on a 32-bit platform
and a 64-bit value on a 64-bit platform).Not CLS-compliant.
UIntPtr No built-in type.UIntPtr No built-in type.UIntPtr No built-in type.UIntPtr
Class objectsObjectThe root of the object hierarchy.ObjectobjectObject*Object
StringAn immutable, fixed-length string of Unicode characters.StringstringString*String

Source: http://msdn.microsoft.com/en-us/library/aa720713(VS.71).aspx

December 8, 2009

CLR Data Types and more

Built-in Types Table
C# Type.NET Framework type
boolSystem.Boolean
byteSystem.Byte
sbyteSystem.SByte
charSystem.Char
decimalSystem.Decimal
doubleSystem.Double
floatSystem.Single
intSystem.Int32
uintSystem.UInt32
longSystem.Int64
ulongSystem.UInt64
objectSystem.Object
shortSystem.Int16
ushortSystem.UInt16
stringSystem.String
Source: http://msdn.microsoft.com/en-us/library/aa287910(VS.71).aspx



Range and Size
TypeRangeSize
booltrue or false (1 or 0)1 bit
sbyte-128 to 127Signed 8-bit integer
byte0 to 255Unsigned 8-bit integer
charU+0000 to U+ffffUnicode 16-bit character
short-32,768 to 32,767Signed 16-bit integer
ushort0 to 65,535Unsigned 16-bit integer
int-2,147,483,648 to 2,147,483,647Signed 32-bit integer
uint0 to 4,294,967,295Unsigned 32-bit integer
long-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807Signed 64-bit integer
ulong0 to 18,446,744,073,709,551,615Unsigned 64-bit integer
TypeApproximate rangePrecision
float±1.5 × 10−45 to ±3.4 × 10387 digits
double±5.0 × 10−324 to ±1.7 × 1030815-16 digits
Source: http://msdn.microsoft.com/en-us/library/exx3b86w(VS.71).aspx and http://msdn.microsoft.com/en-us/library/9ahet949(VS.71).aspx



Default values
Value typeDefault value
boolfalse
byte0
char'\0'
decimal0.0M
double0.0D
enumThe value produced by the expression (E)0, where E is the enum identifier.
float0.0F
int0
long0L
sbyte0
short0
structThe value produced by setting all value-type fields
to their default values and all reference-type fields to null.
uint0
ulong0
ushort0
Source: http://msdn.microsoft.com/en-us/library/83fhsxwc(VS.71).aspx



Implicit Numeric Conversions Table
FromTo
sbyteshort, int, long, float, double, or decimal
byteshort, ushort, int, uint, long, ulong, float, double, or decimal
shortint, long, float, double, or decimal
ushortint, uint, long, ulong, float, double, or decimal
intlong, float, double, or decimal
uintlong, ulong, float, double, or decimal
longfloat, double, or decimal
charushort, int, uint, long, ulong, float, double, or decimal
floatdouble
ulongfloat, double, or decimal
Source: http://msdn.microsoft.com/en-us/library/y5b434w4(VS.71).aspx



Explicit Numeric Conversions Table
FromTo
sbytebyte, ushort, uint, ulong, or char
bytesbyte or char
shortsbyte, byte, ushort, uint, ulong, or char
ushortsbyte, byte, short, or char
intsbyte, byte, short, ushort, uint, ulong, or char
uintsbyte, byte, short, ushort, int, or char
longsbyte, byte, short, ushort, int, uint, ulong, or char
ulongsbyte, byte, short, ushort, int, uint, long, or char
charsbyte, byte, or short
floatsbyte, byte, short, ushort, int, uint, long, ulong, char, or decimal
doublesbyte, byte, short, ushort, int, uint, long, ulong, char, float, or decimal
decimalsbyte, byte, short, ushort, int, uint, long, ulong, char, float, or double
Source: http://msdn.microsoft.com/en-us/library/aa288039(VS.71).aspx

March 9, 2009

Total Pageviews