7/31/2011

How to create an Assembly in .Net

I will show here how to create a simple dll in .net using visual studio 2010, and to link it with other exe.
This may help a .net newbie like me.

Step 1: Create a class library



Step 2: Create a Console application





Step 3: Link the dynamic library

Use add() and sub() methods


Step 4:  Build and Run the project






read more 

7/28/2011

Learn Microsoft's PowerShell

Nice tutorial on Power shell: read

Why do we need PowerShell:

 Traditionally, an Administrator would launch the GUI, select the service, and then either stop or start it. Doesn't seem like a big deal until you are asked to stop a service on multiple computers. Through PowerShell Scripting you will be able to start, stop, and change status types of a service on multiple computers without much effort. Write a script, run-it, and then kick you feet up on the desk.



6/03/2011

Step by Step WCF example

Step by step procedure to create WCF:

A.Creating the service (Server side)

Step 1: Open Visual Studio 2010 and create project ,choose  "Windows Service  Application", and give a name to your project say MyService.

Step 2: Open IService.cs  , in that you can see [ServiceContract] where your intetface name is declared and [OperationContract] here you function contract should be defined here (note: delete the default functions if they are not needed), initialize you addData function here




Step 3: Open Service1.svc.cs and add the code for the addData function, ( note: delete the default functions if they are not needed)

                                  

Step 4: Declare your endpoint in web.config file add the below code which is in  bold and Italics.
                                 
                                   

Step 5:Save the project and run it

                                       
B. Creating the client to consume the service (Client side):

Step 1: Open another Visual studio 2010 , create a new ASP.net web application.right click the project and go to 'Add Service reference' ,copy and paste the service  url and press OK

Step 2: Open Default.aspx , create a simple button and lable controls

Step 3: Double click the button and add this following code

                                         

Ste 4: Build and run the project ,now your client has comsumed the services!!

                                          

read more

msdn :http://msdn.microsoft.com/en-us/library/ms734712.aspx 

5/29/2011

What is C Sharp Using statement

The Using statement in C# allows you to define the scope of an object lifetime, when the end of the using satament is reached  the object Dispose() will be called immediatly.

using (SqlConnection conn = new SqlConnection(connString))
{
     SqlCommand cmd = conn.CreateCommand();
     cmd.CommandText = "SELECT * FROM Customers";
     conn.Open();
     using (SqlDataReader dr = cmd.ExecuteReader()) {
          while (dr.Read())
          // Do Something...
     }
}

This is extremly useful when we need to release a resourece intensive object, like database connection object or a transaction scope                 
                                                                          read more

5/19/2011

APS.net Dropdownlist OnSelectIndex Changed Event

The OnSelectedindexChanged event handler of ASp.net DropDownlist Control enables you to handel the click event of list items at server side that is raised at hte time when user clicks to select a list item of dropdownlist control  read more

What is Active Directory


  • Active Directory stores information about Network Components
  • It allows clients to find objects within the namespace.
  • The term namespace  refers to the area in which the network components are located
  • For example the table of content of a book forms a namespace in which chapters can be resolved to page numbers,
  • DNS is a namespace which resolves host name to IP address
  • Telephone book provides the namespace for resolving names to phone numbers .
  • Active directory provides a namespace for resolving the name of the network objects to objects themselves
  • Every thing that Active directory tracks is considered as an object
  • An object is any user,system,resource or services tracked in active directory
http://wiki.answers.com/Q/What_is_active_directory_and_how_is_it_used
                                                                                                                                                read more

How to force uninstall a program you cannot uninstall

  1. Click Start and choose Run in the menu (If you're using Windows Vista then press Win+R on your keyboard).
  2. Type regedit and hit Enter.
  3. On the left side is the registry settings tree, use it to go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  4. Inside that key you'll find a lot of keys that belong to different programs. Some are named after the program's name, others as a mix of numbers and letters that makes no sense. Look through each of them until you find one that has the key DisplayName (on the right) with your program's name in it.
  5. Notice the key UninstallString - this key points to the uninstall program, and the log file usually resides in the same folder as that program.
  6. If you delete the key in which you've found the DisplayName key with the value equal to your program's name, then your program won't appear on the Add/Remove programs list

5/18/2011

What is CAML

Collaborative Application Markuup Languae is the XML-based language that is used to build and customize web sites based on Sharepoint team Services

CAML can be used to do the following:
 Provide schema definition to the web site provisioning system about how the site looks and acts
 Define views and forms for data and page rendering or execution.
Pulling a value from a particular form

Why do we use CAML:
CAML allows you the ultimate flexibility and extensibility with your Web sites based on SharePoint Team Services from Microsoft. If you want to make a universal change to all the sites that you are creating within your company — for instance, you want to change the logo to match your own company logo, or you want to add an Employee ID field to your document libraries — you must use CAML to do it

Location of CAML:  ( read more )

CAML Query tool :
Collaborative Application Markup Language (CAML) is an XML-based language that developers can use to create custom views and query SharePoint lists. Because it can be difficult to write anything other than basic queries, many tools have been developed to simplify this task. Several of these tools allow developers to write CAML queries within a designer. This is similar to the way developers write SQL queries for many commonly used databases.
  
 download