Thursday, October 8, 2015

Join Clause In Programing With Example

in this topic i am explain about join Clause fetch records from multiple table.

What is Join 
SQL join clause use for fetch record from two or more table base on common fields.
in SQL  There are four types of Joins.
1) Inner-Join
    i-Equi-Join
   ii-Natural Join
2) Outer-Join
   i-Left outer join
  ii-Right outer join
 iii-Full outer join
3) Cross Join 
4) Self Join

Using the join
 join is very useful for fetching records from different tables with reference to common columns between them.
 Example:

Wednesday, September 30, 2015

What is polymorphism?

Polymorphism means many form. ploy means multiple and morph means forms.
in ploymorphism we declare methods with same name and different  parameters in same class or method with same name and same parameters in different classes.

two type of ploymorphism
compile time ploymorphism, (pr early binding, overloading ,static binding)
Run time ploymorphism (or late binding, overriding, dynamic binding)

Method Overloading
              Method overloading is used to increase the readability of program method overloading is perform with in class.
Method overloading performed within class.
in case of method overloading parameter must be different. Method overloading is the example of compile time polymorphism.method overloading cant be performed by changing return type of the method only. Retun type can be same or different in method overloading.but you must have to change the parameter.

Method overriding
              Method overriding is used to provide the specific implementation of the method that is already providing by its super class.
 Method overriding occurs in two classes that have IS-A (inheritance) Relationship.
in Class of method overriding parameter must be same.
Method overriding is example of run time ploymorphism.

Compile time Polymorphism

Public class Class1
{
Public void NumbersAdd(int a,int b)
{
Console.write(a+b);
 }

Public void NumbersAdd(int a , int b , int c)
{
Console.write(a+b+c);
}

}

Run Time Polymorphism

Public class Bclass
{
Public virtual void Sample1()
{
Console.write(“Base classs”);
} }

Public class Dclass:Bclass
{
Public override void Sample1()
{
Console.write(“Derived class ”);
}
}

Class Program
{
Static void main (string [] args)
{
DclassobjDC=new Dclass();
objDc.sample1();
BclassobjBC= new Dclass();
objBc.Sample1();
}
}

Tuesday, July 7, 2015

MS SQL Server Error 18456

in this Article we are learn how to remove error 18456  comes up when we connect  ms sql server with  sql authentication.
these are several step to make user authentication .
1- Connect to Server
 server name =.\SQLEXPRESS
 authentication= Windows Authentication
connect successfully.
2-go to Security and then enter Logins right click on Logins popup bring click on new Login
open new Login screen Popup form Enter Suitable Name for login username select radio button  SQL Server authentication put your password and Confirm password should be same then select default database : XYZ i.e
3- Select  Server Roles check public.
4- Select User Mapping Check Users mapped to this login XYZ.
5- Check on  below Database role membership for XYZ check
db_owner.
6- press ok button
then Disconnect to Server and reconnect to server select sql authentication
fill with login username and password connect the server.
if username and password are not  connect with sql server error 18456 raise.
connect server with windows authentication and right click on  .\SQLEXPRESS go to his property
Server Properties popup  form open  select page Security check radio button  SQL Server and Windows Authentications mode then press OK button. System need to be update take few seconds,
Now right click on .\SQLEXPRESS click on restart button. popup windows form comes up Message written on "Are you sure you want to restart the MSSQL$SQLEXPRESS service on Server name"
Yes or No Press Yes. Loading start after loading ending Disconnect to server and reconnect and select and put login detail and connect successfully.

thanks


how to create new user in MS SQL Server 2012, 2008 or R2

in this Article we are learn how to create user in ms sql server 2012, 2008 or R2.
these are several step to make user authentication .
1- Connect to Server
 server name =.\SQLEXPRESS
 authentication= Windows Authentication
connect successfully.
2-go to Security and then enter Logins right click on Logins popup bring click on new Login
open new Login screen Popup form Enter Suitable Name for login username select radio button  SQL Server authentication put your password and Confirm password should be same then select default database : XYZ i.e
3- Select  Server Roles check public.
4- Select User Mapping Check Users mapped to this login XYZ.
5- Check on  below Database role membership for XYZ check
db_owner.
6- press OK button
then Disconnect to Server and reconnect to server select sql authentication
fill with login username and password connect the server. username successfully connect with sql server.

thanks

Wednesday, July 1, 2015

Object Oriented Programming

OOP is stand for Object Oriented Programming. OOP an approach to designing and building application that are flexible, well crafted and testable by focus on Object that interact cleanly with one another.

four pillar of object oriented programming:
the pillars defining the key characteristic of Object Oriented Programming.
1-Abstraction
2-Encapsulation
3-Inheritence
4-Ployphormism

Friday, June 19, 2015

interface in c#

An Interface look like a class but no implementation. the only thing it contains is declaration of event, indexes, methods and/or property. the reason interface only provide declarations is because they are inherited by struts and classes that must provide an implemention for each interface member declared.

public partial interface IVendorService
   {
       /// <summary>
       /// Gets a vendor by vendor identifier

       Vendor GetVendorById(int vendorId);
 
       /// <summary>
       /// Delete a vendor

       void DeleteVendor(Vendor vendor);
 
       /// <summary>
       /// Gets all vendors
     
       IPagedList<Vendor> GetAllVendors(string name = "", 
           int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false);
 
       void InsertVendor(Vendor vendor);
 
 
       void UpdateVendor(Vendor vendor);
 
 
       VendorNote GetVendorNoteById(int vendorNoteId);
 
       /// <summary>
       /// Deletes a vendor note

       void DeleteVendorNote(VendorNote vendorNote); 
   }