Tuesday, November 10, 2009

Die Mauer ist gefallen



Yesterday was the 20th anniversary of the fall of the wall of Berlin.
I was watching "Good Bye Lenin" a movie who has captured me from it's narrative, a bit pop a few may say but a telling of a change. I wonder how was to live in an enviroment like that. Still more to come for the humanity.

Here is a link I found releted to the activities..


Here is a link from the embassy in my country:





Saturday, November 7, 2009

Controls and differente stuff

i found a few stuff going around in these days.. here are some new stuff to me , from asp.net 2.0 and asp.net 3.5



Hide SideBar of Wizard Control


<asp:Wizard DisplaySideBar="false" >


applying validation group to previous and next button in a wizard control













Friday, November 6, 2009

about how to calculate a checkin -checkout at nights


the solution to the date is like these in the case we just care for the entrance.


Thursday, November 5, 2009

Changes with a list

Inserting from the entity with a list.


foreach(ListItem itemlist in MyListBox.Items)
{
db.MyEntities.InsertOnSubmit(new MyEntity()
{
Id = variableId,
name = itemlist.Value
});
}

with a child:

foreach (ListItem col in SListBox.Items)
{
newentityMaster.Childentity.Add(new Childentity {
FilterId = newfilter.id,
ColumnName = col.Value,

});
}





getting my changes performed (DML, insert, delete, updates).

db.GetChangeSet().Inserts

Visual Studio ShortCuts

Here are some helpful keyboard shortcut keys for Visual Studio 2008. You probably know most, but some you won't know. For instance, did you know that Ctrl+. is the same as Sift+Alt+F10?

Note: Some of the shortcuts won't work in all environment configurations (web, C#, etc).

To use, hold down the control key and hit the key combination. Works on the whole document, a specific line, or a selection of code.

Update References/ Add Using Statement (Ctrl +. or Shift +Alt +F10)
I'm referring to the underline that appears under a variable to perform an action like add a using statement, or refacter a method or class name. Not sure what it's called but I use it all the time. Ex:ClassName

List Members (Ctrl +J or Ctrl +K, L)
Displays the autocomplete list for classes, methods, or properties.

List Parameter Info (Ctrl +Shift +Space or Ctrl +K +P)
Lists the parameters for a method. Use this shortcut when your cursor is inside the parenthesis of a method.

Auto Format (Ctrl +K, D or Ctrl +E, D)
Formats C#, VB, ASPX, Javascript, CSS, XML, XSL, and HTML code according to generally accepted formatting standards for the respective programming language. Makes code look nice and neat.

Quick Watch (Ctrl +Alt +Q)
Highlight some code and hit these shortcut keys to display the Quick Watch dialog.

Comment / Uncomment (Ctrl +K, C / Ctrl +K, U)
Comments or uncomments a block of code. Works with C#, VB, ASPX.

Code Bookmarks
Use these to bookmark a line of code. You can cycle through the bookmarks across any file within a project. Bookmarks come in very handy, try it out.

Set/Unset Bookmark (Ctrl +K, K)
Next Bookmark (Ctrl +K, N)

Surround With (Ctrl +S)
Surrounds a block of code with a code snippet.

Build & Debug Shortcuts
Set/Unset Breakpoint (F9)
Build (F6 or Ctrl +Shift +B)

Start Debugging (F5)

Start Without Debugging (Ctrl +F5)

Stop Debugging (Shift +F5)

Continue (F5)

Step Over (F10)

Step Into (F11)

Step Out (Shift +F11)

Wednesday, November 4, 2009

error on Membership.GetAllUser();

Error calling the method GetAllUser(); this was caused by the fact that i was not having a membership provider for the test application.


listbox.DataSource = Membership.GetAllUsers();









so here's the code snippet used to solve the fact



Monday, November 2, 2009

order by in LINQ (basic example)

I have a table of filters from wich I want to get my last ID inserted , so I thought that I would sort in descending first and get the first element of the list.

Here's how to do a simple task like this.


var firstFilter = db.Filters.OrderByDescending(f => f.id).FirstOrDefault();