• Home
  • About
  • BestBloggingIdeas
  • DotNetLearningSource
  • FORUM
  • Joblinks
  • Latest News
  • Policy
  • POSTS
  • SimplySqlServer.Com && SimplyAspDotNet.Com
  • Sitemap

Join Ours Forum

Asp.Net,C#,Ajax,Sql server,silverlight,Javascript codes exambles articles,Programming exambles

RSS Feed
  • Bounty Huge Roll [Amazon Frustration-Free Packaging]
  • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
  • The Basic Overview of Windows Mobile Development Asp.Net C#
  • Overview of Sql server extended properties Asp.Net C#
  • How to Use Sql Server Extended properties using visual studio Asp.Net C#
  • Adobe Dreamweaver Templates Accelerate Web Development
  • Top Tips for Web Design Projects
  • How to Achieve a Good Web Design Structure
  • To Use Or Not To Use Website Templates
  • Five Tips to a Successful Website
  • Top 10 Articles,


    Silverlight Datagrid Select Update Delete Insert Asp.Net C#

    Differences Similarities Benefits Between Typed Datasets and Untyped Datasets asp.net c#

    Linq to Sql Introduction Entities Ado.Net C# SqlClasses Attributes Linq Mapping

    Linq Programming/How Linq Works?/Linq Implementation In Asp.Net C# Ado.Net

    Performing Developing Using Investigating Asp.Net 2.0 Ajax Application Development Asp.Net C#

    Hosting/Install Wcf Services in a Windows Service Asp.Net C#

    Connecting Silverlight to Wcf Asp.Net C#

    Silverlight Data Grid Data Binding WCF Asp.Net C#

    Invoking/Accessing/Calling WCF Service Without Adding/Creating Proxy/Reference Asp.Net C#

    Performing Doing Creating Insert Update Delete sql data Using Linq Database Asp.Net C#

    What are the new features in C# 3.0/Understanding new features in c# 3.0

    Posted by on July 9, 2010 Leave a comment (10) Go to comments

    Introduction:
    In this article,i am going to explain about some new features in C# 3.0.There are,

    1.Implicitly typed local variables,
    2.Extension Methods,
    3.Anonymous types,
    4.Object Intialisers,
    5.Lambda Expressions,
    6.Automatic Properties,

    Main:

    C# 3.0 provides a new keyword , var, which can be  be used in place of int, bool or string.

    Implicitly typed local variables helps to infer data type as runtime,

    var myInt = 0;
    var myBool = true;
    var myString = "Welcome ...";
     
    sb.Append("myInt is a:  " + myInt.GetType().Name + "   ");
    sb.Append("myBool is a: " + myBool.GetType().Name + "     ");
    sb.Append("myString is a: " + myString.GetType().Name + "     ");
     
    TextBox1.Text = sb.ToString();

    Extension methods:

    Way to extend the contract of a class by adding new  methods without creating in the
    derived class or partial class.

    It’s strongly typed , compiled environment such as CLR.

    Extension methods can be defined for any class, including native classes of the .Net
    Framework.

    An extension methods is defined as a static method on a static class.

    Binding between the method and type is established through the keyword ‘this’ in the
    method’s prototype.

    for ex,

    static class myextension {
    public static  void DisplayType(this object obj) {
    Console.WriteLine(“{0} lives here ? [1] “,obj.GetType().Name,Assembly.GetAssembly(obj.GetType())));
    }
     
    int myInt = 1234;
    TextBox1.Text=myInt.DisplayDefiningAssembly().ToString();

    Object Initializers:

    C# allows to create objects directly,

    Create a new object variable and assign  properties, public fields  and put object initialize
    which consists of a comma-delimited list of specified values, enclosed by the { and }.

    Book objbook = new Book { isbn=123;Author='James' };
     
    List<Book> l= new List<Book> {
    new Person{isbn=103;Author='Peter'},
    new Person{isbn=13;Author='Jenny'} ;
    };

    Anonymous Types:

    If you need a temporary type which is not intended to be reused, you can define anonymous Types.

    ‘var’ keyword used if user does not know at the time of writing code.

    The type of the variable is inferred by compiler  (not runtime).

    var mycar= new  {Color=“red”,Make=“maruthi”,Speed=“250”};
    mycar.Color=“Black” ; //  but Not possible as it is readonly
    Console.WriteLine(“My car  color {0}”,mycar.Color) ;

    Lambda Expressions:

    Lambda expressions allows little coding  constructs and save lot of typing time and used in LINQ.

    Lambda Expressions As a Better Anonymous Method:

    List<int> evennos=list.FindAll(delegate(int ) {return I % 2}==0}};
    foreach(int n in evennos)
    {Console.WriteLine(n);}

    Automatic Properties:

    Using automatic properties,we can remove set and get body properties,

    for ex,
    public string Name {
    get
    {
    return name;
    }
    set
    { name=value; }

    using automatic properties we can change the property declaration like below,

    public string Name { get; set; }

    public class Customer
    {
    public int CustomerId { get; private set; }
     
    public string Name { get; set; }
    public string City { get; set; }
     
    public Customer(int Id)
    {
    CustomerId = Id;
    }
     
    public override string ToString()
    {
    return Name + "t" + City + "t" + CustomerId;
    }
    }
     
    Customer c = new Customer(100);
    c.Name = "James";
    c.City = "Dallas";

    Conclusion:
    Hope this helps,
    Happy Coding.

    C#
    ← Using message contracts in wcf/wcf message contracts programming
    Install/host/deploy/configure wcf service in IIS 6.0/7.0 wcf on web/Steps for installing wcf service to IIS →

    Learn Easily Using Video Tutorials


    How to choose the right Java IDE – explained Eclipse NetBeans BlueJ

    Developing/Creating/Performing/Configuring Java Applications Using Eclipse IDE

    Step By Step Guide for Download/Install Configure Eclipse IDE for Java

    Editing data with the GridView control Asp.Net C#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Best way to prepare asp.net Interview - Success Stories

    Download Important Questions and PPT's:

    Sql Server Important Questions Online free download

    Dotnet Important Questions Online free download

    Exploring Linq to Sql Process Flow

    Learn how to perform silverlight programming

    Learn OOPs concepts in better and well manner

    Learn Ajax in better and well manner

    Leave a comment

    10 Comments.

    1. webdesign July 15, 2010 at 1:15 pm

      I have read couple of articles on your blog and could say it was really interesting, thanks for sharing that.

    2. linki sponsorowane July 21, 2010 at 8:03 am

      Super site, and nice text.

    3. Sharita Kari July 21, 2010 at 3:53 pm

      Hi just stumbled your blog and have been reading, do you also own another a pet related site that looks exactly like this one?

    4. Marguerite Zelko July 21, 2010 at 4:20 pm

      Hello just came across your blog and have been browsing around, do you also own another a pet related website that looks exactly like this one?

    5. Brent Rossmiller July 24, 2010 at 2:28 am

      great article, i just finished bookmarking it for future reference. i would like to revisit on future posts. how do i set up the rss reader again? thanks so much!

    6. Oliver Moreta July 27, 2010 at 12:29 pm

      I got to this blog through Facebook (my friend posted it). After reading it, I then clicked Like and also reshared it. More power to you.

    7. Joanne Veiga July 31, 2010 at 10:37 am

      I got to this article from Facebook (someone posted it). After reading, I of course clicked “Like” then reshared it. More power to you.

    8. colon cleansing December 22, 2010 at 5:45 pm

      I just added your blog site to my blogroll, I pray you would give some thought to doing the same.

    9. veterinary assistant January 2, 2011 at 2:18 pm

      Thank you, I have recently been searching for information about this topic for ages and yours is the best I have discovered so far.

    10. physical therapy January 19, 2011 at 12:49 am

      It’s really a nice and helpful piece of information. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thanks for sharing.

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    *

    *


    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Enter your email address:

    Delivered by FeedBurner

    • Recent Posts

      • Bounty Huge Roll [Amazon Frustration-Free Packaging]
      • XML Introduction to XML VHS Video Training, 1 hr., 32 minutes.
      • The Basic Overview of Windows Mobile Development Asp.Net C#
      • Overview of Sql server extended properties Asp.Net C#
      • How to Use Sql Server Extended properties using visual studio Asp.Net C#
    • Search by Tags!

      Application AspNet Basic between Black Bluetooth Build Business Collection Consultants Design Development Downloading effective Excel Experts Generics Implement Installing Interview Logic Management Microsoft Minutes Object Outlook Professional Programmer Programming Project Projects Questions Ready Select Server Services Silverlight Source Strings Studio Through using Visual Website Wordpress
    • Archives

      • August 2011
      • June 2011
      • May 2011
      • April 2011
      • March 2011
      • February 2011
      • December 2010
      • November 2010
      • October 2010
      • September 2010
      • August 2010
      • July 2010
      • June 2010
      • May 2010
      • April 2010
      • March 2010
      • February 2010
      • January 2010
      • December 2009
      • November 2009
      • October 2009
      • September 2009

    Copyright © 2012 NetProgrammingHelp.com

    Δ Top