Han Cheng

C#, ASP.NET, Microsoft Technologies

  Home  |   Contact  |   Syndication    |   Login
  3 Posts | 0 Stories | 2 Comments | 0 Trackbacks

News

Archives

Post Categories

Wednesday, April 07, 2010 #

   1:  System.Collections.IDictionaryEnumerator enumerator = context.Cache.GetEnumerator();
   2:  while (enumerator.MoveNext())
   3:  {
   4:      context.Cache.Remove(enumerator.Key.ToString());
   5:  }
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Wednesday, November 04, 2009 #

I have downloaded and installed Visual Studio 2010 Beta 2. I noticed a couple of UI (User Interface) improvements over the Visual Studio 2008.

Visual Enhancements

The user interface of the IDE (Integrated Development Environment) is now clean and sleek. Unnecessary lines and gradients are removed to reduce clutter.

Below shows the Start Page after you launch Visual Studio 2010.
Visual Studio 2010 Beta 2 Start Page

When you create a New Project, you noticed that the layout for project type selection has also changed. It is now neat and tidier.
Visual Studio 2010 Beta 2 New Project

One of the cool feature I like is that in Visual Studio 2010, you can undock a source code tab and drag it outside of the IDE. This makes it easier to work with multiple monitors and also while debugging, you can compare source codes side by side.
Visual Studio 2010 Beta 2 Undock Tab
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Saturday, October 31, 2009 #

I will use the AdventureWorks database to demonstrate how to perform CRUD operations using LINQ. You can use LINQPad (a free tool) to execute your C# statements without going through the hassle of writing a program using Visual Studio 2008.

Launch LINQPad, add your SQL Server Connection and select AdventureWorks as the Database. Remember to select C# Statement(s) as the Language Type.

Create Record

1:  Department newDept = new Department()
2: {
3: Name = "Consulting",
4: GroupName = "Consulting",
5: ModifiedDate = DateTime.Now
6: };
7:
Departments.InsertOnSubmit(newDept);
8:
SubmitChanges();

Retrieve Record

1:  var department = from dept in Departments
2: where dept.Name == "Consulting"
3: select dept;
4: department.Dump();

Update Record

1:  Department dept = (from dept in Departments where dept.Name == "Consulting" select dept).Single();
2: dept.GroupName = "Consulting Services";
3:
dept.ModifiedDate = DateTime.Now;
4:
SubmitChanges();

Delete Record

1:  Department dept = (from dept in Departments where dept.Name == "Consulting" select dept).Single();
2:
Departments.DeleteOnSubmit( dept );
3:
SubmitChanges();
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati