Saturday, 23 April 2011

C# Quick Ref



Creating c# class instance using static method

using System;
using System.Collections.Generic;
using System.Text;

namespace OrderFulfellmentServices.Models
{
   public class Class1
   {
       public Class1()
       {

       }
       public static Class1 Instance
       {
           get
           {
               return new Class1();
           }
       }
       public string getBestBuddy()
       {
           return "best buddy";
       }
   }

}


the caller



       public void Callermethod()
       {
...
           var st = Class1.Instance.getBestBuddy();

       }

-----------------------------------



SQLDataReader


Delegates and events



Add data to database using SqlDataAdapter


Bind related tables and display gridview

No comments:

Post a Comment