Showing posts with label GK. Show all posts
Showing posts with label GK. Show all posts

Nov 29, 2020

LINQ in C# (SQL vs LINQ)

linqinc# , linqvssql, linqtosql, linqdistint, linqquerry .c#programming
linq-in-c#
LINQ in C#

        It represents Language Integrated Query. It is a query language design by Microsoft using which we can write queries on a different verity of data sources to retrieve data form data source , like data from Array and collections.

 Basically it is derived from the SQL where SQL used in RDBMS and LINQ is use in programming language like c#.When we going to use LINQ in programming first of all we should import the system.Linq from library.

LINQ program example

Write a program to display the numbers greater than 40 from the array using LINQ statement.

using Systme;

using System.Linq ;

 Staic void Main()

{

   int[] arr = { 23, 34, 43,41, 54, 15, 4, 0, 66, 72, 91, 45, 17,86};

   var brr = from i in arr where i>40 orderby i select i;

   foreach (int a in brr)

      Console.Write({“0}\t”,a);

   Conosole.ReadLine();

}

Difference between SQL and LINQ

SQL

LINQ

   Ã˜  SQL is a Structure Query Language use in RDBMS (Relational Data Base Management System) mainly in Sql Workbench.

   Ã˜  SQL is used in Relational Data Base to retrieve and Manuplication of data from Tables or Relations.

   Ã˜  The syntax of SQL start from ‘Select ‘clause and end with clauses like (where, group by, having and orderby).

   Ã˜  Syntax

Select [<columns>] From [<Table>]  [<Clauses>]

Note : Clauses contain Where, Groupby, Having and Orderby . clauses are optional

and it always in the above sequence.

  Ø  LINQ is a Language Integrated Query use by programmer in programming language, like in c#.

 

  Ø  LINQ is used in programming to retrieve data form Array and Collection.

 

  Ø  The syntax starts with ‘From’ clause and end with ‘Select’ clause.

 

  Ø  Syntax

from [<alias>] in <collection | array> [<Clauses>] Select[<alias>]

here all the place of columns name we going to use alias. Alias in nothing it just a name like ‘I’, ‘a’ whatever you want names it.

 

Example difference

Example difference

Suppose we have a table ‘Num’ contain only one column ‘col1’ and it contain the following data 23, 34, 43,41, 54, 15, 4, 0, 66, 72, 91, 45, 17,86

Suppose we have an array

‘arr’ contain the following data same as in table 23, 34, 43,41, 54, 15, 4, 0, 66, 72, 91, 45, 17,86

List col1 greater than 40

Select col1 From Num Where col1> 40 orderby col1;

print array greater than 40

from i in arr where i>40 orderby i select i;

 


Mar 3, 2020

ARRAYLIST IN C# (Diff. b/w Array & ArrayList )

ArrayList in c#

            "ArrayList is a class of Collections^ ,and it's a data structure that store collection of data just like an array". But it's is little bit different than ArrayList See the detail difference between Array and ArrayList at bottom of this page.  

EXAMPLE OF ARRAYLIST

      1.    How to declare ArrayList in C#
To declare an ArrayList first step to add the directive System. Collection, and what have to do is we have to the instantiate the instance of ArrayList as we did  to the class instance with the help of new keyword see the example
        using System.Collections;
        static void Main()
        {
            ArrayList List = new ArrayList ();
            // the name of ArrayList will be 'List' or you can chose your own name
 }
      2.    How to add item/values into an Arraylist in C#
arraylist, array vs arraylist in c#, java arraylist, arraylist in collection
arraylist in c#
            With the a help of Add keyword we will add object type data in ArrayList
See it
       static void Main()
        {
            ArrayList List = new ArrayList ();
            List.Add(100);
            List.Add("Jhony");
            List.Add('a');
        }
      3.    How to read an ArrayList in C#
Like the old process but little bit change we have to use the Add keyword like this
       static void Main()
        {
            ArrayList List = new ArrayList();
            Console.WriteLine("Enter items into ArrayList");
            List.Add(Console.ReadLine());
        }
       4.    How to write and display the output of an ArrayList in C#
            Because of the ArrayList we will use foreach loop to print the ArrayList
       static void Main()
        {
            ArrayList List = new ArrayList();
            Console.WriteLine("Enter items into ArrayList");
            List.Add(Console.ReadLine());
difference between array and arraylist, arraylist, array    
array vs arraylist
            List.Add(100);
            List.Add("Jhony");
            List.Add('a');
            Console.Write("Array items are ");
            foreach (object obj in List)
                Console.Write(" " + obj);
            Console.ReadKey();
        }
      5.    How to insert item/values in the middle of ArrayList
            For this you to specify the index number at the place we want to add the item and by using insert keyword we will insert at any point. Like suppose the above program I want to add 150 in between the "Jhony" and 'a' thus we have to add at index number 3 because index start at zero let do it.
        static void Main()
        {
            ArrayList List = new ArrayList();
            Console.WriteLine("Enter items into ArrayList");
difference between array and list, java list vs arraylist, array and arraylist, arraylist example
array to arraylist
            List.Add(Console.ReadLine());
            List.Add(100);
            List.Add("Jhony");
            List.Add('a');
            List.Insert(3, 150);
            foreach (object obj in List)
                Console.Write(" " + obj);
            Console.ReadKey();
        }
      6.    How to delete item from middle of ArrayList
            By use of either Remove keyword and specify the 'object obj'. Or RemoveAt keyword by specifying index number. Suppose above program I want to delete "Jhony" we have two ways
First (Remove keyword and specify the 'object obj')       
static void Main()
        {
            ArrayList List = new ArrayList();
            Console.WriteLine("Enter items into ArrayList");
arraylist clear, arraylist of objects in java, array vs arraylist c#
array to arraylist
            List.Add(Console.ReadLine());
            List.Add(100);
            List.Add("Jhony");
            List.Add('a');
            List.Insert(3, 150);
            List.Remove("Jhony");
            foreach (object obj in List)
                Console.Write(" " + obj);
            Console.ReadKey();
        }
Second (RemoveAt keyword by specifying index number)
       static void Main()
        {
            ArrayList List = new ArrayList();
            Console.WriteLine("Enter items into ArrayList");
            List.Add(Console.ReadLine());
            List.Add(100);
            List.Add("Jhony");
            List.Add('a');
            List.Insert(3, 150);
            List.RemoveAt(4);
            foreach (object obj in List)
                Console.Write(" " + obj);
            Console.ReadKey();
        }

Feb 28, 2020

How i do freelancing without skill

Freelance Work That Require No Skillful Skill

        Some freelance works that requires no proper experience and not has to learn outside of our daily works just focus on some rear things and you can easily do freelancing..From my respected sir 'Sir Hisham Sawar' some very important tips and works that will bring a positive changes in you career specaially for medical, law and engineering student that want to do freelancing. 
  
            

how i do freelance without skill, works that requires no skill in freelancing
freelancing without skill



Jan 29, 2020

GOOGLE CHROME SHORTCUTS

google chrome shortcuts, shortcuts, shortcut keys while using internet
internet shortcuts

GOOGLE CHROME SHORTCUTS

Shortcut
Function
Ctrl + O
To open any data/file in internet search engines
Ctrl + N
To open new internet window not tab
Ctrl + Shift + N
To open new internet window with black background
Ctrl + T
To open new tab
Ctrl + F4
To close the open tab
Ctrl + W
To close the internet search engine
Alt + F4
Alt + f4 = =  Ctrl + W
Ctrl + J
To open download window
Ctrl + S
To save page
Ctrl + R / F5
To reload page
Ctrl + ‘+’
To zoom in the tab page
Ctrl + ’- ’
To zoom out the tab page
Ctrl + P
To print the  open page
Ctrl + U
To inspect he open page
Ctrl +  H
To open history
Ctrl + Shift+ T
To open recent close tabs
Ctrl + D
To bookmark page
Ctrl + Shift + O
To open bookmark pages
Ctrl + Shift + D
To bookmark all open tabs
Ctrl + Shift + I / F12
To open Google light house
Ctrl + F / F3
To open find box
Ctrl + numbers (1 to 10)
To switch the tabs in order
Ctrl + Tab
To switch the tabs randomly
Ctrl + page down
To switch the open tab with right tabs
Ctrl + page up
Ro switch the open tab with left tabs
Ctrl + Left arrow key
To go backward pages
Ctrl + Right arrow key
To go  page  forward
Page Down
To scroll down in page
Page Up
To scroll page up / Inverse of page down
Upper arrow key
To scroll page up / Inverse of page down
Down arrow key
To scroll down in page









YouTube shortcut keys