C# > IO > FileInfo Class
FileInfo
Use this class for working with files: create, open, delete,
move, rename.
Methods
Properties
Search This Blog
Friday, October 17, 2014
Thursday, October 16, 2014
String IsNullOrEmpty C# Example
C# > String > Methods > IsNullOrEmpty
With this method you can test simultaneously test whether a String is null or its value is Empty.
Example
With this method you can test simultaneously test whether a String is null or its value is Empty.
Example
string s = "test";
bool b = String.IsNullOrEmpty(s); // false
s = null;
b = String.IsNullOrEmpty(s); // true
s = "";
b = String.IsNullOrEmpty(s); // true
s = " ";
b = String.IsNullOrEmpty(s); // false
Etichete:
c#
Wednesday, October 15, 2014
CONVERT SQL Server Example
SQL Server > Built-in Functions > CONVERT
CONVERT converts an expression of one data type to another.
CONVERT converts an expression of one data type to another.
Example
select CONVERT(nvarchar(30), GETDATE(), 100)
result
Oct 15 2014 9:54AM
Other examples:
Etichete:
SQL Server
Where keyword generic generic type constraint example C#
C# > Generics > where - generic type constraint
With where keyword you can apply restrictions to the kinds of types that client code can use for type arguments when it instantiates the generics class.
Example
With where keyword you can apply restrictions to the kinds of types that client code can use for type arguments when it instantiates the generics class.
Example
public class A
{
}
public class B:A
{
}
public class GenericList <T> where T : A
{
}
GenericList<A> lst1 = new GenericList<A>(); // OK
GenericList<B> lst2 = new GenericList<B>(); // OK B derives from A
GenericList<int> lst3 = new GenericList<int>(); //Error 1 The type 'int' cannot be used as type parameter 'T' in the generic type or method 'WindowsFormsApplication1.GenericList'. There is no boxing conversion from 'int' to 'WindowsFormsApplication1.A'.
Etichete:
c#
Tuesday, October 14, 2014
Ushort Type C# Example
Byte Type C# Example
C# > Types > byte
The byte keyword is an integral type.
Range: 0 to 255
Example:
The byte keyword is an integral type.
Range: 0 to 255
Example:
byte k = 255; // ok
k = 256; // Error
Etichete:
c#
Wednesday, October 8, 2014
APP_NAME SQL Server Example
SQL Server > Built-in Functions > APP_NAME
APP_NAME returns the application name for the current session.
Example:
APP_NAME returns the application name for the current session.
Example:
select APP_NAME();
Result:
Microsoft SQL Server Data Tools, T-SQL Editor
Etichete:
SQL Server
Subscribe to:
Posts (Atom)