Creating a DDL File & link ddl file in C#


 Creating a DDL File & link ddl file  in C#


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

namespace ClassLibraryExample
{
    publicclass ClassLibrary
    {
        privatestring name;
        privatestring last;
        privatestring fullname;

        publicstring Name
        {
            get{ return name; }
            set{ name = value; }
        }
      
  publicstring Last
        {
            get{ return last; }
            set{ last = value; }
        }
     
 publicstring Fullname
        {
            get{ return fullname; }
            set{ fullname = value; }
        }
     
   publicvoid show()
        {
 Console.WriteLine("Employee Name: " + Name);
Console.WriteLine("Employee LastName:"+ Last);
Console.WriteLine("Employee FullName:"+Fullname);
        }
    }
}

--------------------------LINK DDL File---------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
usingClassLibraryExample;
namespace DDLwithPropertiesExamples
{
class Program
 {
static voidMain(string[] args)
 {
 ClassLibrarye1 = new ClassLibrary();
 e1.Name = "Ram";
 e1.Last = "singh";
 e1.Fullname = (""+e1.Name +""+ e1.Last);
 e1.show();
 Console.Read();
}}}

Comments

Popular posts from this blog

SQL Command in asp.net