Steveluo’s Blog

Just another WordPress.com weblog

Archive for July, 2009

What a advanced C# developer should know

Posted by steveluo on July 19, 2009

1.  http://stackoverflow.com/questions/365489/questions-every-net-developer-should-be-able-to-answer
2. http://stackoverflow.com/questions/1099621/what-all-should-an-expert-c-net-wpf-developer-know
3. “What Great .NET Developers Ought To Know”,

Advertisements

Posted in Uncategorized | Leave a Comment »

Linq(2) to DataTable

Posted by steveluo on July 19, 2009

Generally we need get an  initial dataset  from Database by Sql   and then use  linq to filter it again to serve different purposes.   the article show how to create a tableView based on linq:

  • EnumerableRowCollection query   
  •               = from customer in dtCustomer.AsEnumerable()   
  •                 where customer.Field(“State”) == “NJ”  
  •                 select customer;   
  •             DataView njview = query.AsDataView();  

    the chapter Chapter 14 in LinQ in Action gives us the details.  and Other examples on the web and Linq to DataTable  example1 

  • Points to understand Linq:  (from Joseph Rattz’s book)
    1)  linq, a query,  returnes set of objects is called a sequence.  Most linq sequences are of type IEnumerable<T>
    2)  a lambda expression in C# with format:   
             a)
    (param1, param2, …paramN) => expr
             b) 
    (param1, param2, …paramN) =>   {   statement1; statement2; … statementN; return(lambda_expression_return_type); }
           e.g:   
    x => x.Length > 0   could be read as   “input x returns x.Length > 0.”

    Linq Wiki
    get data from Excel by linq

     

     

     

    Posted in Uncategorized | Leave a Comment »