Five Pillars of .NET Programming
Five Pillars of .NET Programming
Posted in Labels: Ado.net | at 5:04 AM
Five Pillars of .NET Programming
Posted in Labels: Ado.net | at 8:34 AM
Posted in Labels: ASP.NET | at 8:22 AM
What is Indexer ?
Posted in | at 9:51 PM
int[] verdierX = new int[8];
private void Form1_Load(object sender, EventArgs e)
{
for (var i = 0; i < 8; i++)
{
TextBox tb = (TextBox)FindControl("box" + i.ToString());
verdierX[i] = (int)decimal.Parse(tb.Text);
}
}
Posted in Labels: ASP.NET | at 8:15 AM
Posted in Labels: ASP.NET | at 7:30 AM
Posted in Labels: ASP.NET | at 4:47 AM
Posted in Labels: WCF | at 3:08 AM
Base Namespace: System.ServiceModel
using System; using System.Collections.Generic; using System.Net.Security; using System.ServiceModel; using System.Text; namespace Microsoft.WCF.Documentation { [ServiceContract( Namespace="http://microsoft.wcf.documentation", Name="SampleService", ProtectionLevel=ProtectionLevel.EncryptAndSign )] public interface ISampleService{ [OperationContract] string SampleMethod(string msg); }
Use the ServiceContractAttribute properties to modify the service contract.
The ConfigurationName property specifies the name of the service element in the configuration file to use.
The Name and Namespace properties control the name and namespace of the contract in the WSDL element.
The SessionMode property specifies whether the contract requires a binding that supports sessions.
The CallbackContract property specifies the return contract in a two-way (duplex) conversation.
The HasProtectionLevel and ProtectionLevel properties indicate whether all messages supporting the contract have a explicit ProtectionLevel value, and if so, what that level is.
Posted in Labels: ASP.NET | at 2:55 AM
Posted in Labels: Prepare for an Interview | at 4:49 AM
Posted in Labels: Prepare for an Interview | at 4:22 AM
Posted in Labels: Prepare for an Interview | at 3:57 AM
Posted in Labels: ASP.NET | at 2:52 AM
Managing Unhandled Exception You can manage unhandled exception with custom error pages in asp.net. You should configure the
Posted in Labels: ASP.NET | at 2:24 AM
*** Understanding DateTime and TimeSpan in .Net through real time example :
Posted in Labels: Prepare for an Interview | at 11:47 PM
Provides a collection similar to an array, but that grows dynamically as
the number of elements change.
Example
static void Main()
{
ArrayList list = new ArrayList();
list.Add(11);
list.Add(22);
list.Add(33);
foreach(int num in list)
{
Console.WriteLine(num);
}
}
Output11
22
33
A collection that works on the Last In First Out (LIFO) principle,
i.e., the last item inserted is the first item removed from the collection.
Push - To add element and
Pop – To Remove element
Example
using System;
using System.Collections;
class Test
{
static void Main()
{
Stack stack = new Stack();
stack.Push(2);
stack.Push(4);
stack.Push(6);
while(stack.Count != 0)
{
Console.WriteLine(stack.Pop());
}
}
}
Output
6
4
2
Queue Concept in .Net
A collection that works on the First In First Out (FIFO) principle, i.e.,
the first item inserted is the first item removed from the collection.
Enqueue - To add element and Dequeue – To Remove element
Example:
static void Main()
{
Queue queue = new Queue();
queue.Enqueue(2);
queue.Enqueue(4);
queue.Enqueue(6);
while(queue.Count != 0)
{
Console.WriteLine(queue.Dequeue());
}
}
Output
2
4
6
Hashtable Concept in .Net
Provides a collection of key-value pairs that are organized
based on the hash code of the key.
Example:
static void Main()
{
Hashtable ht = new Hashtable(20);
ht.Add("ht01", "DotNetGuts");
ht.Add("ht02", "EasyTutor.2ya.com");
ht.Add("ht03", "DailyFreeCode.com");
Console.WriteLine("Printing Keys...");
foreach(string key in ht.Keys)
{
Console.WriteLine(key);
}
Console.WriteLine("\nPrinting Values...");
foreach(string Value in ht.Values)
{
Console.WriteLine(Value);
}
Console.WriteLine("Size of Hashtable is {0}", ht.Count);
Console.WriteLine(ht.ContainsKey("ht01"));
Console.WriteLine(ht.ContainsValue("DailyFreeCode.com"));
Console.WriteLine("\nRemoving element with key = ht02");
ht.Remove("ht02");
Console.WriteLine("Size of Hashtable is {0}", ht.Count);
}
Output
Printing Keys...
ht01
ht02
ht03
Printing Values...
DotNetGuts
EasyTutor.2ya.com
DailyFreeCode.com
Size of Hashtable is 3
True
True
Removing element with key = ht02
Size of Hashtable is 2
SortedList Concept in .Net
Provides a collection of key-value pairs where the items are sorted according to the key. The items are accessible by both the keys and the index.
Example:
static void Main()
{
SortedList sl = new SortedList();
sl.Add(18, "Java");
sl.Add(5, "C#");
sl.Add(11, "VB.Net");
sl.Add(1, "C++.Net");
Console.WriteLine("The items in the sorted order are...");
Console.WriteLine("\t Key \t\t Value");
Console.WriteLine("\t === \t\t =====");
for(int i=0; i {
Console.WriteLine("\t {0} \t\t {1}", sl.GetKey(i),
sl.GetByIndex(i));
}
}
Output
Key Value
==
1 C++.Net
5 C#
11 VB.Net
18 Java
for more ex: http://dng-collections.blogspot.com/
Posted in Labels: Prepare for an Interview | at 11:33 PM
1. Explain Connection Pooling?
Posted in Labels: ASP.NET | at 10:22 PM
DataBinder.Eval() Method
DataBinder.Eval() method saves you from writing complex expressions.
For example, make your datagrid column to template field.
Now, lets understand it various use with different example.
Posted in Labels: ASP.NET | at 8:17 PM
URL Rewriting with URLRewriter.Net
URL Rewriting has lots of benefits, listing its main benefits
Before URL Rewriting my URL looks like
http://localhost:2661/URLRewrite2/DynamicPage.aspx?MyTitleId=1
After URL Rewriting URL is changed to
http://localhost:2661/URLRewrite2/Article/Asp-Net-website-paths-1.aspx
Read Users' Comments (1)comments
Copyright 2009
Happy Programming
Free WordPress Themes
designed by
EZwpthemes
Converted into Blogger Templates by Theme Craft | Falcon Hive