Ok. Let's try Linq with database now. Database I use was SQL Express 2005. Let's begin the lessons: First, create new project, choose windows application. Second, choose data connection and data source of database we want to use. Third, add new item and choose Linq to SQL Classes. The file will create and drag the tables or stored procedure in it. Fourth, done. Hahaha. And now, let's use Linq in database case. Here we can see how easy we can manipulate the code and the efficiency of writing code in vb 9. Debug.Print(Presensi.nama_karyawan, Presensi.Uang_Makan) Those codes above will connect to presensi where the presensi was stored procedure in my database. Below is an example of dbml (LINQ TO SQL CLASSES). Hope you enjoy it.
Dim presen = From absensi In db.Presensi(2008, 4) Select absensi
For
Each Presensi In presen
Next
Thursday, May 29, 2008
Simple Manipulation Database with VB Express 2008
XML Code with VB Express 2008
Function CreateDocument() Return_ <?xml End The code above show us how to create XML code more easier and in one framework. Vb 9 can regconize the XML code and execute those code like vb do with their own code. Those code will return the result in xml code with "organizer" as a root. What vb 9 can do with those xml code is truly amazing. We can play with xml code and generate the xml code again. Here the example: Sub testingXML() Console.WriteLine(doc(0)) Console.WriteLine(contact) Console.WriteLine("{0,-40} {1,-20}", contact2.<name>.Value, contact2.<address>.Value) Console.ReadKey() Try it yourself what vb 9 get with those code. It's amazing. J
version="1.0"
encoding="UTF-16"
standalone="yes"?>
<organizer>
<contact
category="home">
<name>John Smith</name>
<address>New York</address>
</contact>
<contact
category="home">
<name>Layong</name>
<address>Indonesia</address>
</contact>
<contact
category="work">
<name>Jack Brock</name>
<address>London</address>
</contact>
</organizer>
Function
Dim doc() = CreateDocument()
Dim contacts = From cont In doc.Descendants("organizer") _
Where cont.Attribute("category").Value = "home" _
Select cont
Dim contacts2 = From cont2 In doc...<organizer> _
Select cont2
For
Each contact In contacts
Next
For
Each contact2 In contacts2.<contact>
Next
End
Sub
Monday, May 26, 2008
Tips for choosing Powerpoint Projectors
When I got this website, it’s reminding me about my business now. First, when I setup my business, I must prepare likes computers, projector and etc. Especially for projector, I learn something here. There are so many kinds of projectors likes: video projectors, powerpoint projectors, and etc.
So, when I choose the projector, I must see my needs first. If we mostly use the projector for video, then you must choose the video projector, and if you only use the projector for presentation, the powerpoint projectors is suit for your needs.
There are some features you must consider if you choose powerpoint projectors.
• Choose Higher resolutions like SXGA (1,280x1,024) or minimally XGA (1024x768).
• Choose projectors with the newer menu or features.
• Set your color and brightness with counting the size of your room
• Consider the font size too..
So, now when you present your presentation, hopefully your audiences are happy to listen.
Ups.. forgot. Review of this website: this website contains a lot of projectors. So, you can choose the right projectors for your needs. And gladly this website offers you the best price.
Thursday, May 22, 2008
Join 2 variables with Linq (VB Express 2008)
Class Person Sub TestingClass2() People.Add(New Person With {.Age = 16, .Name = "Angie"}) People.Add(New Person With {.Age = 20, .Name = "Brandy"}) Console.WriteLine(peopleDet1.Name) Console.WriteLine(peopleDet1.Name2) Console.ReadKey() The codes above show us how to create variable with Person type/class. There are 2 ways how to add the value in it. Here the ways: First way: Dim People As People.Add(New Person With {.Age = 16, .Name = "Angie"}) People.Add(New Person With {.Age = 20, .Name = "Brandy"}) Second way: Dim People2() = {New Person With {.Name = "Herry", .Age = 16}, _ New Person With {.Name = "Jerry", .Age = 25}} The codes up there is the same, but have a major different on it. First ways is easier when we insert the new record/value in people variable, but second ways, we easy to write because we can make it one line code, but difficult to read it and also second way not friendly if we want to insert the new record in the different line. Also, the codes above teach us how to join two variables in the simple way. I want to join 2 variables where the condition " age = 16 " and get the name of the person. Dim peopleDet = From peo In People Join peo2 In People2 On peo.Age Equals peo2.Age _ Where peo.Age = 16 Select peo.Name, Name2 = peo2.Name The result will return "Angie" and "Herry", because their age is same. Ok. Have a nice coding.. :)
Public Age As Integer
Public Name As String
End Class
Dim People As New List(Of Person)
Dim People2() = {New Person With {.Name = "Herry", .Age = 16}, _
New Person With {.Name = "Jerry", .Age = 25}}
Dim peopleDet = From peo In People Join peo2 In People2 On peo.Age Equals peo2.Age _
Where peo.Age = 16 Select peo.Name, Name2 = peo2.Name
For Each peopleDet1 In peopleDet
Next
End Sub
New List(Of Person)
Monday, May 19, 2008
First Project with Visual Basic Express 2008
Today, I was trying visual basic express 2008. It’s free version from Microsoft but still powerful for creating simple software. As we know, Microsoft says in Visual Studio 2008 had new feature like LinQ. LinQ is code template like SQL Query but it’s more powerful. LinQ make us easier to query database, array, and even variables.
Okay let’s try it. This is my first try and if I got it wrong, feel free to tell me at the comment side.
To begin the first project, you need Visual Basic Express 2008, which you can download at: http://www.microsoft.com/express/vb/
Let’s begin to rock VB Express 2008. :)
1. Open your VB Express 2008
2. Choose ConsoleApplication and choose “OK” button.
3. Create a simple sub procedure like this:
Sub NumQuery()
Dim numbers() = {1, 4, 2, 7, 8, 9}
Dim evenNumbers = From num In numbers Where num Mod 2 = 1 Select num
Console.WriteLine("Result :")
For Each number In evenNumbers
Console.WriteLine(number)
Next
Console.ReadKey()
End Sub
4. Then, in “Sub Main()”, write this code like this:
Sub Main()
NumQuery()
End Sub
5. Done… hehehe
You can see at this line of code:
Dim evenNumbers = From num In numbers Where num Mod 2 = 1 Select num
Which it mean: we choose data from numbers and place in the num variable where the condition num mod 2 = 1, and last the result of num will place on evenNumbers variable.
For Each number In evenNumbers
Console.WriteLine(number)
Next
Those codes will execute and display the result in console mode.
What do you think about this new feature of Visual Basic Express 2008. :)
Have a nice day.
Thursday, May 15, 2008
Peazip – Great Compression Tool
Peazip is tool for compression. Peazip is free software and free to spread. Peazip can open and compress in 12 different type, likes: zip, 7z, pea, tar, etc. when I use peazip, I think peazip compression is not small than winzip or winrar, but now I change my mind. Peazip can do even better than winzip or winrar.
Benefits of peazip are:
1. Peazip is very small program (about 7 Mb).
2. Peazip is user friendly.
3. Peazip can compress good enough.
4. Peazip is free.
5. Peazip can support a lot of files type.
Now, I try to share a little about how to use peazip:
1. Choose create archive or open archive
1. Choose Add File
2. Choose type of compress and level of compress
3. Choose create .7z and type filename
4. Progress bar of peazip compress
. Different between original file and peazip file
Simple huh.. hehehe. Next time I will share how to extract with peazip.
Thx. Good day.
| Read More | Join My Community | Grab RSS | Stumble it |Wednesday, May 14, 2008
SumatraPDF – Simple PDF Reader
SumatraPDF is open-source software that useful to read a PDF files. SumatraPDF is very small software, even we didn’t need to install it. What we need just copy and paste SumatraPDF into our hard drive and run it. Here the look of SumatraPDF:
SumatraPDF was created by Krzysztof Kowalczyk. Here the look when we open the PDF files:
The benefits of SumatraPDF:
1. Simple because SumatraPDF didn’t need to be installed on our hard drive, SumatraPDF only need to be copied on our hard drive and run it.
2. Free of Cost. Sumatra is free software that we can use and spread it.
3. Fast. Because of this very small size of SumatraPDF make it very fast on opening the PDF files.
The weakness of SumatraPDF:
1. Sometimes SumatraPDF cannot open the new version of PDF Files.
2. Result of SumatraPDF printing is not good (low resolution).
3. Open the PDF files in new windows when we open the new files.
Here the site where you can download SumatraPDF: SumatraPDF-0.8-install.exe








