C# > Data > DataTable > Loop all rows
foreach (DataRow row in DataTable1.Rows)
{
m_v = row["ColName"].ToString();
}
Search This Blog
Thursday, December 20, 2012
HTTP (Hypertext Transfer Protocol)
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web.
When a user opens their Web browser, the user is indirectly making use of HTTP.
HTTP is an application protocol that runs on top of the TCP/IP protocols.
When a user opens their Web browser, the user is indirectly making use of HTTP.
HTTP is an application protocol that runs on top of the TCP/IP protocols.
Etichete:
HTTP
Tuesday, December 18, 2012
Find locked tables SQL Server
SQL Server > Dynamic Management Views and Functions > sys.dm_tran_locks
Returns information about currently active lock manager resources in SQL Server. Each row represents a currently active request to the lock manager for a lock that has been granted or is waiting to be granted.
Example:
Find locked tables SQL Server
select
object_name(P.object_id) as TableName,
resource_type,
resource_description
from
sys.dm_tran_locks L
join sys.partitions P on L.resource_associated_entity_id = p.hobt_id
Returns information about currently active lock manager resources in SQL Server. Each row represents a currently active request to the lock manager for a lock that has been granted or is waiting to be granted.
Example:
Find locked tables SQL Server
select
object_name(P.object_id) as TableName,
resource_type,
resource_description
from
sys.dm_tran_locks L
join sys.partitions P on L.resource_associated_entity_id = p.hobt_id
Etichete:
SQL Server
Static Constructors C#
C# > Class > static constructor
A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only. It is called automatically before the first instance is created or any static members are referenced.
Static constructors have the following properties:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
public class Log
{
// Static constructor:
static Log()
{
System.Console.WriteLine("The static constructor invoked.");
}
public static void Write(string text)
{
System.Console.WriteLine("The Write method invoked.");
}
}
class Program
{
static void Main(string[] args)
{
Log.Write("text"); // constructor invoked
Log.Write("text"); // constructor not invoked.
}
}
}
A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only. It is called automatically before the first instance is created or any static members are referenced.
Static constructors have the following properties:
- A static constructor is called automatically to initialize the class before the first instance is created or any static members are referenced.
- A static constructor cannot be called directly.
- A typical use of static constructors is when the class is using a log file and the constructor is used to write entries to this file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
public class Log
{
// Static constructor:
static Log()
{
System.Console.WriteLine("The static constructor invoked.");
}
public static void Write(string text)
{
System.Console.WriteLine("The Write method invoked.");
}
}
class Program
{
static void Main(string[] args)
{
Log.Write("text"); // constructor invoked
Log.Write("text"); // constructor not invoked.
}
}
}
Etichete:
c#
Friday, December 14, 2012
protected C#
C# > Access Modifiers > Protected
The protected access modifier is between the private and public and is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member.
Example:
The protected access modifier is between the private and public and is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member.
Example:
namespace WFA
{
public class A
{
protected int x = 1;
private int y;
}
public class B : A
{
B()
{
x = 2; // can access x, but cannot access y
A a = new A();
a.x = 1; // Error: Cannot access protected member 'WFA.A.x' via a
qualifier of type 'WFA.A'; the qualifier must be of type 'WFA.B' (or derived
from it)
}
}
Etichete:
c#
Partial Class c#
C# > Class > Partial
Partial split the definition of a class over more source files.
Each source file contains a section of the class definition, and all parts are combined when the application is compiled.
Use partial class when:
public partial class Car
{
public int Year()
{
}
}
public partial class Car
{
public void Go()
{
}
}
Partial split the definition of a class over more source files.
Each source file contains a section of the class definition, and all parts are combined when the application is compiled.
Use partial class when:
- working on large projects allows multiple programmers to work on it simultaneously.
- working with automatically generated source, code can be added to the class without having to recreate the source file.
public partial class Car
{
public int Year()
{
}
}
public partial class Car
{
public void Go()
{
}
}
Etichete:
c#
Application Request Routing IIS
IIS Application Request Routing (ARR) 2.5 enables Web server administrators, hosting providers, and Content Delivery Networks (CDNs) to increase Web application scalability and reliability through rule-based routing, client and host name affinity, load balancing of HTTP server requests, and distributed disk caching. With ARR, administrators can optimize resource utilization for application servers to reduce management costs for Web server farms and shared hosting environments.
Microsoft Application Request Routing (ARR) for IIS 7 and above is a proxy-based routing module that forwards HTTP requests to content servers based on HTTP headers, server variables, and load balance algorithms. ARR can be used to:
The Application Request Routing installer package contains the following components:
Microsoft Application Request Routing Version 2.5 for IIS 7 (x64)
Microsoft Application Request Routing Version 2.5 for IIS 7 (x86)
Microsoft Application Request Routing (ARR) for IIS 7 and above is a proxy-based routing module that forwards HTTP requests to content servers based on HTTP headers, server variables, and load balance algorithms. ARR can be used to:
- Increase application availability and scalability.
- Better utilize content server resources.
- Facilitate application deployment including pilot management and A/B testing.
- Lower management costs and create opportunities for shared hosters.
The Application Request Routing installer package contains the following components:
- Microsoft URL Rewrite Module for IIS.
- Microsoft Web Farm Management Version 1 for IIS.
- Microsoft Application Request Routing Version 1 for IIS.
- Microsoft External Cache Version 1 for IIS.
Microsoft Application Request Routing Version 2.5 for IIS 7 (x64)
Microsoft Application Request Routing Version 2.5 for IIS 7 (x86)
Etichete:
IIS
Subscribe to:
Posts (Atom)