Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • LINQ

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 41
    Comment on it

    Language Integrated Query is a way to manipulate list objects and arrays using SQL query.

     

    For manipulating LINQ to array there is an example for that

     

    /*Code to manipulate array with LINQ*/
    
    Ex: string[] Employees = { "Himanshu", "Mahesh", "Robin",
                       "Neeraj", "Sudheer", "Seema
                         ","Mayuri", "Suresh"
                      };
    
    var list = from b in Employees
               where b.StartsWith("H")
               select b;
    
    StringBuilder sb = new StringBuilder();
    
    foreach (string s in list)
    {
        sb.Append(s + Environment.NewLine);
    }
    
    MessageBox.Show(sb.ToString(), "H Employees");
    
    

     

    In this example we have a collection of employee array which gets stored into variable using the LINQ query in which we are manipulating it through the LINQ functions.

    The  function StartsWith("H")  will return only those employee whose name starts with R.

     

     

     

    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: