FCI-Helwan blog

Just another FCI-H weblog

What’s new in C# 3.0 ? Part 4

in this post i will speak about 3 small things:-
1: – Object initializers.
2: – Query expression.
3:- implicitly typed arrays.

1: – Object initializers :-
Now i can initialize any public property in object construction, so there is no need to write multiple
constructors like this eg ..

point p = new point { x = 5 , y = 9 } ;
button btn = new button { Text = “username” , Width = 20 , Height = 5 } ;
and so on .. where Text,Widht and Height are Public properties in the Button Class.

2: – Query expression :-
i will explain it directly in a small example : -

from c in students
where c.Name == “BillGates”
select c.address.
now this became apart of C# syntax now we can get a compilation error if i wrote wrong
statement ( in the previous versions of C# we were writing it between ” “.
the query expression not just for sql statements but also i can use it in my arrays or any structure i made in my code.
( really this is great ) .

3 : – implicitly typed arrays :-
it is same as implicitly typed variable the type of the array is inferred from the initialization value like this :-
var a = new [] { 1, 2, 3 } ; //array of intergers.
var b = new [] { “hi”,”man”}; // array of srings.
var c = new [] { 1, 2, “kkk”}; // Compilation error.

That’s it.
See you in the Next Part isA

February 14, 2007 Posted by fcihelwanblogger | C# | | 1 Comment

MDC07 – Day3 Slides updated

February 14, 2007 Posted by fcihelwanblogger | MDC07 | | No Comments Yet

Get your Video Series: SQL Server 2005 Express Edition for Beginners CD

We would like to announce about we have downloaded “Video Series: SQL Server 2005 Express Edition for Beginners
So, for whom they like to take it, kindly, drop a comment! just to know the number of people, 3rd year students have higher priority as they study Microsoft SQL Server 2000
So, volunteers who will burn more CDs kindly, drop a comment!
Actually there are 5 CDs for anyone and 5 CDs for volunteers (who should copy at least one CD for other people)

February 14, 2007 Posted by fcihelwanblogger | Announcements, Database, MSSQL | | 4 Comments

Announcement

Now you can access our blog through www.hasebat.com

Dr. Ayman Ezzat (Teaching Assistant in our faculty) has forwarded his domain www.hasebat.com to our blog. So now you can access our blog through this domain.

Many thanks to him.

Dr.Ayman’s Web site: http://www.iplab.cs.tsukuba.ac.jp/~ayman/

February 14, 2007 Posted by fcihelwanblogger | Announcements | | 1 Comment