Oracle Connection in C#

simple oracle connection in C# (Oracle 10g & XE)

First, let me tell you about the types of ADO .NET programming, there are two types of it. There are DataSet and OleDbCommand.
The difference is, on DataSet, instances of this class represent in-memory caches of data, so you don’t have to maintain an active connection to modify the contents of a datasource. It is a better way than using OleDbCommand, which in this approach, SQL statements are executed directly on the datasource, very wasteful right?
But, this article are just for dummies =P , so I’m using OleDbCommand on it (for Oracle, it’s named OracleCommand ). OK then, first, you must add a reference to your project. View the solution explorer then right-click at your project’s root, choose add reference. On .NET tab, choose the System.Data.OracleClient. Now, your Oracle-Client is ready for use!
For opening an Oracle connection, you need at least this three namespaces ;

using System;
using System.Data;
using System.Data.OracleClient;
//remember that an Oracle-Client must have already installed on your PC. In this example, I used Oracle XE //as my Oracle-Client service. All Oracle-Client have the same methods to get connected, you just have to //change the SID, pretty simple mate !
//Now, it’s time for the best part, the Oracle connection string. Please behave nicely =P
private OracleConnection conn;
public bool OpenConnection(string SID, string user, string password)
{
try
{
//instance new oracle connection
conn = new OracleConnection(“Data Source=”+SID+ “; User Id=”+user+”; Password=”+password+”;”);
//open the connection
conn.Open();
return true;
}
catch (Exception) //this is your first time ! so,learn to use “try catch” as available as possible! it’s very important!
{
return false;
}
}
//There are two basic conditions on executing SQL command, first is query command (select * from //[table_name]) , second is non-query command (insert,update,delete).
//Here are the codes ;
// this is a method for executing query command
public void execQuery(string sql) {
OracleCommand cmd = new OracleCommand(sql);
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
try
{
OracleDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
//read the query result. On this example, i put three names of my database fields, there are “NAMA” ,”ALAMAT”,”EMAIL”
Console.WriteLine(Convert.ToString(reader["NAMA"]));
Console.WriteLine(Convert.ToString(reader["ALAMAT"]));
Console.WriteLine(Convert.ToString(reader["EMAIL"]));
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
cmd.Dispose();
}
}
//this is a method for executing non-query command
public bool execNonQuery(string sql) {
OracleCommand command = new OracleCommand(sql);
command.Connection = conn;
try
{
//a non-query command doesn’t need any reader, all you have to do is execute them !
command.ExecuteNonQuery();
return true;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return false;
}
}

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Create a Crystal Report Visual studio

Crystal Reports has been a part of Visual Basic since 1993, and a part of Visual Studio since its first release in 2002. Crystal Reports has been a very successful component of these products. With the release of Visual Studio 2010, SAP and Microsoft have mutually decided to change how we deliver this important component to the .NET developer community going forward.

Starting on Friday, April 16th, the beta version of Crystal Reports for Visual Studio 2010 will be available as a separate download from this site.  Just like when Crystal Reports was integrated into the  Visual Studio installation, this download will continue to be free.

Crystal Reports for Visual Studio 2010 will contain many new features compared to Crystal Reports Basic for Visual Studio 2008.  This blog on the SAP Developer Network goes into more detail on the new features and how they benefit report designers, .NET developers, and report consumers.

Both SAP and Microsoft believe this change in delivery method will allow for faster innovation of our respective products, and more value for our mutual customers.  

In this video you can see how to create a crystal report in C#.


 

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Evolution of Email

Evolution of Email (1965 – 2011*)

Email has transformed the way we all interact. According to a survey by Microsoft, most people expect their email usage to increase or stay the same within the next five years. Take a journey with Microsoft Outlook through some of the key turning points in email’s history.
You may also like to check out:


Evolution of Email
Add caption

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Dynamic Crystal Reports from C# Application

Usually Crystal Reports generating with pre-defined columns . That is, the fields showing in Crystal Reports are selecting through a wizard at the time of Crystal Report design.
The following program describes how to generate a Crystal Report in C# with dynamic columns at the time of report generation . That is, we are not selecting any column from database table at the time of Crystal Report design. Instead of that we are passing an SQl query string and get the Crystal Report dynamically at runtime in C# . From the following picture you can understand how it works.
csharp-crystal-report-dynamic-column
All C# Crystal Reports Tutorial in this website is based on the following database - crystaldb. So before you begin this section , please take a look at the database structure of crystaldb - Click Here C# crystaldb
If you are new to Crystal Reports and do not know how to create Crystal Reports from C# , please take a look at the section step by step tutorial for creating a Crystal Reports from C#.
Here we are going to create a Dynamic Crystal Report with the help of Strongly Typed Dataset. Create a new CSharp project and add a Strongly Typed Dataset in the C# Project . Before creating a Strongly Typed Dataset take a look at the detailed tutorial of how to create a C# Crystal Report from Strongly Typed Dataset of previous section .
Hope you understand how to create a C# Crystal Report from Strongly Typed Dataset. Create a new C# project and add a Strongly Typed Datset . Add five columns in the DataTable of Strongly Typed Dataset. Here we are limiting as five column , but you can add any number of column according to your reports requirements.
csharp-crystal-dynamic-column
Next step is to create a Crystal Reports design from the Strongly Typed dataset. You have to add a Crystal Report in your project and select data source as Strongly Typed Dataset. If you don't know how to do this section , refer the previous section of How to create a C# Crystal Report from Strongly Typed Dataset.
csharp-crystal-report-dynamic-table
Select all the column (five) from Strongly Typed Dataset .
csharp-crystal-report-dynamic-column-selection
Click finish button . Then you can see the selected fields in the Crystal Repots . Arrange the fields according to your requirement . Now the designing part is over and the next step is to call the Crystal Reports in CSharp and view it in Crystal Reports Viewer control .
Select the default form (Form1.cs) you created in CSharp and drag a Textbox , button and CrystalReportViewer control to your form (like in the first picture ).
Here we are going to pass the SQl statements to Crystal Reports at runtime from C# program . For that we have to parse the SQL statement before we passing it to Crystal Reports. So we create a function for parsing SQL statements in the C# program.
Public Function procesSQL() As String
You have to include CrystalDecisions.CrystalReports.Engine in your C# Source Code.
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
Copy and paste the following source code and run your C# project
Download Source CodePrint Source Code
Free Ajax Application Generator!
Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
Looking at Distributed Data Grids?
Today�s developers have discovered that distributed data grids unleash application performance and scalability. Try ScaleOut StateServer� and give your apps a boost. Download a free evaluation copy!

using System;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data;
using System.Data.SqlClient ;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        CrystalReport1 objRpt = new CrystalReport1(); 

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection cnn ;
            string connectionString = null;
            string sql = null;
            connectionString = "data source=SERVER NAME;initial catalog=crystaldb;user id=USER NAME;password=PASSWORD;";
            cnn = new SqlConnection(connectionString);
            cnn.Open();
            sql = procesSQL();
            SqlDataAdapter dscmd = new SqlDataAdapter(sql, cnn);
            DataSet1 ds = new DataSet1();
            dscmd.Fill(ds, "Product");
            objRpt.SetDataSource(ds.Tables[1]);
            crystalReportViewer1.ReportSource = objRpt;
            crystalReportViewer1.Refresh();
        }

        public string procesSQL()
        {
            string sql = null;
            string inSql = null;
            string firstPart = null;
            string lastPart = null;
            int selectStart = 0;
            int fromStart = 0;
            string[] fields = null;
            string[] sep = { "," };
            int i = 0;
            TextObject MyText ;

            inSql = textBox1.Text;
            inSql = inSql.ToUpper();

            selectStart = inSql.IndexOf("SELECT");
            fromStart = inSql.IndexOf("FROM");
            selectStart = selectStart + 6;
            firstPart = inSql.Substring(selectStart, (fromStart - selectStart));
            lastPart = inSql.Substring(fromStart, inSql.Length - fromStart);

            fields = firstPart.Split(',');
            firstPart = "";
            for (i = 0; i <= fields.Length - 1; i++)
            {
                if (i > 0)
                {
                    firstPart = firstPart + ", " + fields[i].ToString() + " AS COLUMN" + (i + 1);
                    firstPart.Trim();

                    MyText = (TextObject) objRpt.ReportDefinition.ReportObjects[i+1];
                    MyText.Text = fields[i].ToString();
                }
                else
                {
                    firstPart = firstPart + fields[i].ToString() + " AS COLUMN" + (i + 1);
                    firstPart.Trim();

                    MyText = (TextObject)objRpt.ReportDefinition.ReportObjects[i+1];
                    MyText.Text = fields[i].ToString();
                }
            }
            sql = "SELECT " + firstPart + " " + lastPart;
            return sql;
        } 
    }
}

connectionString = "data source=SERVER NAME;initial catalog=crystaldb;user id=USER NAME;password=PASSWORD;";
You have to provide the necessary database information to Connection String.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Java Word Count

Word Count Example in Java

This example illustrates how to count the number of lines, number of words and number of characters in the specified file. Program takes the file name as parameter and it counts the number of words and lines present in the file. Parameter is optional and if you simply run the program without mentioning the file name then you will have to input some strings and program will count the number of characters and number of words for your given strings. This topic is related to the I/O (input/output) of java.io package.
In this example we are using FileReader class of java.io package. The File class is an abstract representation of file and directory pathnames.

Explanation
This program counts the number of lines, number of words and number of characters in the specified file. We will be declaring two functions called wordcount and linecount in the program. The function linecount has been overloaded according to the passing argument. If you input contents through the file then linecount function will be called (If specified file exists) otherwise main function counts the number of characters and number of lines (always, the number of line will be only 1 in this condition) itself but for the counting of the number of words by using the wordcount function.

wordcount(String line)
The function wordcount(String line) takes either the content of the specified file or arguments passed with the run command for a java program as parameter 'String line'. The wordcount() function is using arrayname.charAt(index) to find position of space in the string.  A counter variable 'numWords' is used to count the number of words.

linecount(String fileName);
The function linecount(String fileName) takes the specified file name as a string parameter and create a instance for the FileReader class to buffering then the file or string and it is passed to the function linecount(String fName, BufferedReader in).

linecount(String fileName, BufferedReader);
The function linecount(String fName, BufferedReader in) takes the specified file name and created instance in for the BufferedReader class by calling function linecount(String fileName) and assign the content of the buffer in a string variable line. And then the function linecount(String fileName, BufferedReader) counts and print the number of characters, number of lines. To count the number of words call the wordcount(String line) function.

Code of the Program : 
import java.io.*;

public class  WordCount{
  private static void linecount(String fName, BufferedReader in) 
  throws 
IOException{
  long numChar = 0;
  long numLine=0;
  long numWords = 0;
  String line;
    do{
      line = in.readLine();
      if (line != null){
        numChar += line.length();
        numWords += wordcount(line);
        numLine++;
      }
    }while(line != null);
    System.out.println("File Name: " + fName);
    System.out.println("Number of characters: " + numChar);
    System.out.println("Number of words: " + numWords);
    System.out.println("Number of Lines: " + numLine);
  }
  private static void linecount(String fileName){
    BufferedReader in = null;
    try{
      FileReader fileReader = new FileReader(fileName);
      in = new BufferedReader(fileReader);
      linecount(fileName,in);
    }
    catch(IOException e){
      e.printStackTrace();
    }
  }
  private static long wordcount(String line){
    long numWords = 0;
    int index = 0;
    boolean prevWhiteSpace = true;
    while(index < line.length()){
      char c = line.charAt(index++);
      boolean currWhiteSpace = Character.isWhitespace(c);
      if(prevWhiteSpace && !currWhiteSpace){
        numWords++;
      }
      prevWhiteSpace = currWhiteSpace;
    }
    return numWords;
  }
  public static void main(String[] args){
    long numChar = 0;
    long numLine=0;
    String line;
    try{
      if (args.length == 0)
      {
        BufferedReader in =
        new BufferedReader(new InputStreamReader(System.in));
        line = in.readLine();
        numChar = line.length();
        if (numChar != 0){
          numLine=1;
        }
        System.out.println("Number of characters: " + numChar);
        System.out.println("Number of words: " + wordcount(line));
        System.out.println("Number of lines: " + numLine);
      }else{
        for(int i = 0; i < args.length; i++){
          linecount(args[i]);
        }
      }
    }
    catch(IOException e){
      e.printStackTrace();
    }
  }
}

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Installing Wordpress on Wamp

To install Wordpress on Wamp,

1) Download wordpress from http://wordpress.org/download/
2) Move zip file to a new folder in www directory
3) Extract zip file
4) cOPY AND paste files from extracted folder into wordpress folder
5) In browser open http://localhost/phpmyadmin/
6) Create a new database
7) In address bar type: http://localhost/WORDPRESS/
8) Select Create a configuration file
9) Select Let's Go
10) Add Database name, username, password and a new table prefix (if desired)
For wamp, this could be:
    Database name: wordpress1
    Database username: root
    Database password:
    Database host: localhost
    Table prefix (if you want to run more than one WordPress in a single database): mywp_or wp_
11) Select Submit
12) Select Run the Install
13) Add a Site Title, Username and Password.
14) Select Install Wordpress

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Quick Tips to Speed up WordPress

Quick Tips to Speed up WordPress


WordPress is a powerful and very flexible CMS that helps to develop highly dynamic and user friendly websites. It incorporates a number of useful features in a site and helps it to perform better. This is the reason why most of the website owners are going for CMS web development, and specially towards WordPress based website. However, without good load speed, a site is good for nothing. Discussed below are some of the tips to speed up a WordPress based website.

• Always keep the site up to date with the latest releases. It is very important. This is because with every update, the performance is enhanced to a great degree. The updates are released to include more advanced and better features. Therefore, one must always keep the site up to date.

Same rule applies to WordPress plug-ins. It is very important to stay up to date with the latest versions. New plug-ins re released to introduce the modified code in order to make the plug-in better. Therefore, it is in your best interest to keep yourself updated with the latest releases.

• Disable or delete the unused plug-ins. One of the biggest reasons behind slowing down of a WordPress site is the presence of unused plug-ins. Depending on the type of plug-in, they can have tons of script and code. So if you do not want a particular plug-in, it is best to disable it or even delete it. It is better to decide beforehand which plug-in is required for your site to run. This will help you to eliminate the unwanted plug-ins.

• Do clean up the code. It is the code that makes a site run, it is imperative to optimize it. This can really do wonders and can improve the load time considerably. Some of the ways to clean up the code and make the site load faster are discussed below.

-Decrease Whitespace: Whitespace is the space used in the code. Some of the coders like to use a lot of whitespace (indented tabs, line breaks etc) in order to provide better readability and good organization. However, decreasing whitespace can really help in speeding up the load time of a site as it shaves off the extra bytes off the total size.

-Use external scripts: It is better to use external scripts in the header.php file in place of tons of code. This helps the browser to cache the script and saves it from reading every other page.

• Minimize PHP and database queries. This is because if the browser has to execute any PHP query each time a page is loaded, it will only add to the load time. Replace PHP queries with static HTML.

These are the most common tips shared by wordpress developers, and believe it or not these small and basic tips increase speed tremendously

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Create Bootable Windows Server 2008 USB

I recently had the need to install Windows Server 2008 from a USB stick. This was because I didn't have a working DVD drive to hand. I found a couple of tutorials online explaining how to create the disk. They generally explained this technique:
C:\> diskpart

DISKPART> list disk

     Select the USB device from the list and substitute the disk number below
     when necessary

DISKPART> select disk 1
DISKPART> clean
DISKPART> create partition primary
DISKPART> select partition 1
DISKPART> active
DISKPART> format fs=fat32
DISKPART> assign
DISKPART> exit

xcopy X:\*.* /s/e/f Y:\

     where X:\ is your mounted image or physical DVD and Y:\ is your USB
     device
However it appears diskpart is unable to see USB sticks under Windows XP. I have later tried on Vista and this limitation appears removed. But for those using Windows XP I have found an alternative method.
Firstly find the bootsect.exe tool on the Windows Server disc (in the boot directory). Then run this command where U is the drive letter of the USB stick.
D:\boot> bootsect.exe /nt60 U:
Now copy all the files from the Windows Server disc onto the USB stick. This can be done by dragging in the GUI or using the xcopy method shown previously.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Creating a bootable USB flash drive for Windows XP

The ability to boot Windows XP from a USB Flash Drive (UFD)offers endless possibilities. For example, you might make an easy-to-usetroubleshooting tool for booting and analyzing seemingly dead PCs. Or you couldtransport your favorite applications back and forth from home to work withouthaving to install them on both PCs.
However, before you can create a bootable UFD, you mustclear a few hurdles. You saw that one coming didn't you?
The first hurdle is having a PC in which the BIOS will allowyou to configure the USB port to act as a bootable device. The second hurdle ishaving a UFD that that will work as a bootable device and that's large enoughand fast enough to boot an operating system such as Windows XP. The thirdhurdle is finding a way to condense and install Windows XP on a UFD.
If you have a PC that was manufactured in the last severalyears, chances are that its BIOS will allow you to configure the USB port toact as a bootable device. If you have a good quality UFD that's at least 512 KBand that was manufactured in the last couple of years, you've probably cleared thesecond hurdle. And once you've cleared those first two hurdles, the third oneis a piece of cake. All you have to do is download and run some free softwareto create the bootable UFD.
I'll start by showing you how to determine whether your PC's BIOS will support booting from USB and explain how toconfigure it to do so. Then, I'll show you how to download and use the freesoftware to create a bootable UFD running Windows XP Professional.

The UFD hurdle

You probably noticed that I didn't mention how to determineif your UFD would support being configured as a bootable device, except that itmust be a good quality unit of recent manufacture. Well, I've discovered thatwhen it comes to the actual UFD, you'll just have to try it and see whathappens. As long as you have a PC with a BIOS that will allow you to configurethe USB port to act as a bootable device and you have configured theinstallation correctly, it shouldwork. If it doesn't, you probably have a UFD that can't boot.
I tested three UFDs on two newcomputers and had mixed success. First, I attempted to use a 128 MB PNY Attache but received an error message that said "Invalid ordamaged Bootable partition" on both PCs. Next, I tried a 1GB Gateway UFD and itworked on both PCs. Then, I tried a 256 MB Lexar JumpDrive Pro and it worked ononly one of the PCs. You can find lists of UFD brands that others have hadsuccess with on the Internet.

Checking the BIOS

Not every new BIOS will allow you to configure the USB portto act as a bootable device. And some that do allow it don't make it easy. On oneof my example systems, it was a no-brainer. On the other, the UFD had to beconnected to the USB port before it was apparent that I could configure it as abootable device. Let's take a closer look.
On the test system with a PhoenixBIOS version 62.04, Iaccessed the BIOS, went to the boot screen, and found that USB Storage Stickwas one of the options. I then moved it to the top of the list, as shown in Figure A, thus making it the firstdevice to check during the boot sequence. (This particular BIOS also allowed meto press the [F10] key during the boot sequence and select any one of theavailable bootable devices, so it really wasn't necessary to move it to thetop.)
Figure A
The settings on the Boot Screen of the PhoenixBIOS made it a no-brainer toselect the device.
On the test system with an AMI BIOS version 2.59, I accessedthe BIOS, went to the Boot Sequence screen, and didn't find a USB boot option,as shown in Figure B. I then wentone step further and checked the Hard Disk Drives screen and still didn't finda USB boot option, as shown in Figure C.
Figure B
A USB boot option didn't appear on the Boot Sequence screen.
Figure C
The Hard Disk Drives screen only showed the SATA hard disk.
I then plugged a UFD into the USB port, booted up the system,and accessed the BIOS. When I checked the Hard Disk Drives screen, the UFDappeared in the list and I could select it as the first drive (Figure D).
Figure D
With the UFD plugged into the USB port, I could configure the UFD as abootable device.
When I returned to the Boot Sequence screen, the UFD wasindeed set as the first bootable device (FigureE).
Figure E
As the Boot Sequence screen indicates, the UFD was set to be the first bootable device.

Rounding up the software

To condense and install Windows XP on a UFD, you'll need aprogram called PE Builder by Bart Lagerweij. You'll also need two files fromthe Windows Server 2003 Service Pack 1. And of course, you need to have aWindows XP Professional CD.
You can download PE Builder from Bart's Website. At the time of this writing, the most current version of PEBuilder was 3.1.10a.
You can download Windows Server 2003 SP1 by following thelink in the Knowledge Base article "Howto obtain the latest service pack for Windows Server 2003." Besure to get the 32-bit version!
Keep in mind that at 329 MB, Windows Server 2003 SP1 willtake some time to download. And although you need just two small files, theonly way to get them is to download the entire package.

Warning

Do not run the Windows Server 2003 SP1 executable file! Doingso will completely corrupt Windows XP. We will use a set of special commands toextract the two files and then delete the rest of the package.

Preparing the software

Installing PE Builder is quick and easy. Just run theinstallation program and follow the onscreen instructions. To make things simpler,I installed the program in the root directory in a folder called PEBUILDER3110a.
Once PE Builder is installed, you'll need to create a folderin C:\PEBUILDER3110a called SRSP1, as shown in Figure F. This is the folder in which PE Builder will look for theextracted Windows Server 2003 SP1 files.
Figure F
Once PE Builder is installed, you'll need to create folder called SRSP1 inC:\PEBUILDER3110a.
Now, you can begin extracting the two needed files fromWindows Server 2003 SP1. When you download the Windows Server 2003 SP1, theexecutable file will have a long name: WindowsServer2003-KB889101-SP1-ENU.exe. Tosave on typing, you can rename the file to something shorter, such asWS-SP1.exe.
To begin, open a Command Prompt window and use the CDcommand to change to the folder in which you downloaded the Windows Server 2003SP1 executable file. I downloaded the file to a folder called Downloads. Now,to extract the files contained in SP1, type the command
WS-SP1.exe -x
You'll immediately see a dialog box that prompts you toselect a folder in which to extract the files and can type the name of the samefolder, as shown in Figure G. ClickOK to proceed with the extraction procedure. When the procedure is complete, justleave the Command Prompt window open.
Figure G
You can extract the files into the same folder containing the WindowsServer 2003 SP1 executable file
The extraction procedure will create a subdirectory calledi386 and extract all the Windows Server 2003 SP1 files there. Use the CDcommand to change to the i386 folder and then copy the setupldr.binfile to the SRSP1 folder with the command:
copy setupldr.bin c:\pebuilder3110a\srsp1
Expand the ramdisk.sy_ file to theSRSP1 folder with the command:
expand -r ramdisk.sy_ c:\pebuilder3110a\srsp1
These three steps are illustrated in Figure H.
Figure H
You'll copy and expand the two necessary files to the SRSP1 folder.
Now, using Windows Explorer, verify that the two necessaryfiles are in the SRSP1 folder, as shown in FigureI. Once you do so, you can delete all the Windows Server 2003 SP1 files.
Figure I
You'll want to verify that the setupldr.bin and ramdisk.sys files are in the SRSP1 folder.

Running PE Builder

Now that you've extracted the necessary files from theWindows Server 2003 SP1 package, you're ready to use PE Builder to create acompressed version of Windows XP. To begin, place your Windows XP ProfessionalCD into the drive and hold down the [Shift] key to prevent Autostartfrom launching the CD. Then, launch PE Builder.
In the Source field on the main PE Builder screen, simplytype the letter of drive in which you put the Windows XP Professional CD, asshown in Figure J. Make sure thatthe Output box contains BartPE and that the None optionis selected in the Media Output panel. Then, click the Build button.
Figure J
Fill in the Source field on the main PE Builder screen.
As PE Builder compresses Windows XP Professional into abootable image, you'll see a detailed progress dialog box. When the operationis complete, as shown in Figure K,click the Close button.
Figure K
PE Builder displays a detailed progress report.

Preparing the UFD to boot Windows XP

At this point, you're ready to format and copy the WindowsXP Professional bootable image to the UFD with the BartPEUSB Installer. To do so, open a Command Prompt window and use the CD command tochange to the pebuilder3110a folder. Then, insert your UFD into a USB port andtake note of the drive letter that it is assigned. On my example system, theUFD was assigned drive E.
Now, type the command
pe2usb -f e:
You'll then be prompted to confirm this part of theoperation, as shown in Figure L.While the operation is underway, you'll see progress indicators.
Figure L
You'll be prompted to confirm that you want to format your UFD.
Once the BartPE USB Installerfinishes its job, you'll be prompted press any key to exit the program. Now youcan use your UFD to boot your computer into the BartPEinterface for Windows XP, as shown in FigureM.
Figure M
The BartPE interface provides you with a pareddown version of Windows XP.
You can find a list of specializedapplications on Bart's Web site, which you can install on your UFDas Plugins. For example, you can find such things asFirefox or McAfee command-line virus scanner.

Conclusion

Booting Windows XP from a UFD requires that your PC's BIOS support booting from USB and that you have a UFDthat can be formatted as a bootable device. If you can meet these tworequirements, all you need is PE Builder, a couple of files from the WindowsServer 2003 Service Pack 1, and a little effort to configure a UFD to boot the BartPE interface to Windows XP.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

How to Install Windows 7 in VMware Workstation

VMware is a virtualization platform where you can install multiple Operating Systems (OS) on your desktop or laptop computer.
For example, if your computer is running Windows Vista but you want to experiment with Windows 7 for development or certification, you can install a guest OS of Windows 7. In fact, you can install an entire virtual domain on a single computer.
With VMware Workstation, you no longer need to purchase multiple physical computers to meet your development or certification needs. A desktop or laptop with good processing power and plenty of available memory is all that you will need to unlock your desktop from a single OS to multiple OS’s.
For example, my current configuration is a 64-Bit computer with a quad-processor and 8GB of RAM. It allows me to run up to 10 virtual machines simultaneously. If your computer is 32-bit with 2-4 GB of RAM, you can run 1-4 virtual machines simultaneously. You can experiment with the memory settings depending on the specifications of the computer you own.
Note: Please review the specifications of VMware prior to downloading the software to assure that your computer meets the minimum requirements.

VMware Workstation System Requirements

The hardware requirements are as follows:
  • Standard x86?compatible or x86?64?compatible personal computer
  • 1.3GHz or faster CPU minimum
  • Multiprocessor systems are supported
  • Support for 64?bit guest operating systems is available with Intel VT or AMD?V CPUs
  • Operating system installation media (disk or disk image) for virtual machines
  • For Windows 7 Aero Graphics Support:
    • Intel Dual Core, 2.2GHz and above or AMD Athlon 4200+ and above
    • nVidia GeForce 8800GT and above or ATI Radeon HD 2600 and above
    • At least 3GB of host system memory

Download a Free 30-Day Trial Copy

If you want to follow along with the steps that I’m going to demonstrate in this tutorial, you’re going to need a trial or licensed version of VMware Workstation. You can download a trial version here.
When you run the executable, follow the simple wizard to install the software. You may be prompted to reboot your computer after the installation of VMware Workstation.

Creating a Virtual Machine

Let’s begin by opening VMware Workstation from the Start menu. Alternatively, you can type, “VMware” in the instant search field and select VMware Workstation from the list of programs (Figure 1).
Creating a Virtual Machine
Figure 1: VMware Workstation Main Window
Next, click File | New | Virtual Machine. A wizard appears to create a new virtual machine as shown in Figure 2.
How to Install Windows 7 in VMware Workstation
Figure 2: New Virtual Machine Wizard
Click “Next” and choose how you want to load Windows 7. You can load it from installation media (DVD) or you can use an ISO image. For the purposes of this article, we will use an ISO image (Figure 3).
How to Install Windows 7 in VMware Workstation
Figure 3: Loading Windows 7 from an ISO Image.
Next, select “Installer disc image file (ISO)” and browse to where your Windows 7 ISO image resides. Click “Next” and enter the Windows 7 product key (Figure 4).
Note: You can optionally personalize Windows 7 with a user and password.
How to Install Windows 7 in VMware Workstation
Figure 4: Entering a Windows 7 Product Key
Click “Next”, and enter a virtual machine name and choose a location for your virtual machine to reside. You can simply accept the defaults and move forward in the installation (Figure 5).
How to Install Windows 7 in VMware Workstation
Figure 5: Entering a Virtual Machine Name and Location
Click “Next” and accept (Figure 6) the default disk size of 40 GB. You can increase or decrease this size as you see fit.
Experimenting with different sizes will help you obtain your sweet spot for all Windows 7 virtual machines. Additionally, you have the option of splitting the virtual machine in 2 GB files; this will help when moving your virtual machines between computers.
How to Install Windows 7 in VMware Workstation
Figure 6: Specify the Disk Capacity
Click “Next” and you can customize your virtual machine hardware prior to beginning the Windows 7 virtual machine Operating System (OS) load (Figure 7).
For example, you can add disks, serial ports, and printers. You can also remove unnecessary hardware such as floppy drives and sound cards (Figure 8).
How to Install Windows 7 in VMware Workstation
Figure 7: Customizing Virtual Machine Hardware
How to Install Windows 7 in VMware Workstation
Figure 8: Add/Remove Hardware
Click OK and Finish and Windows 7 begins to load (Figure 9). Since you entered the product key, VMware Workstation enters an “Easy Install” mode. Just sit back, relax, and a Windows 7 virtual machine is installed.
How to Install Windows 7 in VMware Workstation
Figure 9: Windows 7 “Easy Install”

VMware Tools

In the current version of VMware Workstation (VMware Workstation 7), the VMware Tools are automatically installed so you no longer have to worry about whether you remembered to install the VMware Tools or not. The VMware Tools install the following components:
  • VMware Tools service
  • VMware device drivers
  • VMware user process
  • VMware Tools control panel

Working with a Virtual Machine

Now that your virtual machine (Figure 10) is ready, you can use it like it was a physical computer. If you choose View | Full Screen, you can work with your virtual machine a full-screen mode. Other options you have when working with virtual machines is the following:
  • Power On a Virtual Machine
  • Power Off a Virtual Machine
  • Suspend a Virtual Machine into Memory
  • Snapshot a Virtual Machine
How to Install Windows 7 in VMware Workstation
Figure 10: Windows 7 Virtual Machine
Now that you are familiar with VMware Workstation, experiment with the different settings, test new drivers and software on Windows 7. Additionally, you can use VMware Workstation to prepare for any certification programs you wish to achieve.
Finally, if you must stay current on a wide range of different technologies, including the multitude of operating systems on the market such as Windows 95, 98, NT4, 2000, XP, Vista, Server (2000, 2003, 2008), and other permutations of the Windows operating systems, VMware Workstation and virtualization is the answer.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

install Windows Home Server in VMware Workstation


How do I install Windows Home Server in VMware Workstation


Before we begin, you will need several downloads. If you do not already own VMware Workstation, you can download an evaluation copy at www.VMware.com. You will also need the Windows Home Server software, which is also available for a trial period. Furthermore, it is much easier to load a virtual operating system by creating an ISO image (see “Using WinISO to Build a Virtual Machine Installation Directory“) as opposed to running it directly from the DVD. The Windows Home Server (WHS) installation takes a good bit to load, so sit back and enjoy the ride.
Our first step is to configure our virtual machine by opening VMware Workstation from the Start (orb) menu. Once VMware Workstation is open, choose File | New Virtual Machine (Figure A).

Figure A

clip_image002 Next, choose Custom Install and choose Workstation 6 as the VM platform of choice, as shown in Figure B and Figure C.

Figure B

clip_image004

Figure C

clip_image006 Since Windows Home Server (Figure D) is not an option as a supported guest OS in VMware, choose Windows Vista and its location on your network (Figure E).

Figure D

clip_image008

Figure E

clip_image010 Now you can choose the number of processors you want to run. If you have a Duo core CPU, you can use two processors for your VM, which greatly increases the performance (Figure F).

Figure F

clip_image012 On the next window, set the memory to 512, as shown in Figure G, or your OS load will not be successful.

Figure G

clip_image014 On the Network Type Window, you can choose several types of networking. For the purposes of this example, choose Use Bridged Networking and for the I/O Adapter, choose BusLogic, as shown in Figure H.

 Figure H

clip_image016 You are now ready to create your virtual disk, as shown in Figure I.

 Figure I

clip_image018 On your Specify Disk Capacity, choose a disk size of 80GB. During the Windows Home Server installation, the disk is automatically partitioned. I spent a while trying to figure this out (Figure J). If you do not have a minimum of 80GB, the install will fail.

Figure J

clip_image020 Note: You can add more drives with larger amounts of disk space if you are going to use this scenario to really back up all your computers on your network. I purchased a terabyte backup drive for $200.00, and I added a 350 GB virtual disk to my Windows Home Server virtual machine.
You can now name your disk file, as shown in Figure K, and click Finish. Congratulations, as Figure L shows, you have now created the skeleton to load Windows Home Server.

Figure K

clip_image022

Figure L

clip_image024
We will move on now and attach the Windows Home Server ISO image to your virtual machine. Click Edit Virtual Machine Settings (Figure A) from the WHS VM and highlight CD-ROM |Use ISO Image (Figure B) and browse to the image you created. Alternatively, you can just choose Use Physical Drive, but be prepared to wait a very long time for the OS load.

Figure A

clip_image002

Figure B

clip_image004 Click OK. Before we fire up our VM, we must first download the VMSCSI-1.2.0.4.flp driver. This is a floppy image that allows us to use the buslogic adapter.
We are now ready to Start this virtual machine. You will get a message stating that Windows Vista does not support BusLogic SCSI adapter (Figure C). Ignore and click OK.

Figure C

clip_image006 Windows Home Server will now go through an install screen very similar to Windows Vista until a Windows Home Server Error appears telling you that it can’t find a hard drive. At this point, you are ready to load the floppy image driver that you downloaded from VMware’s Web site (Figure D).

Figure D

clip_image008 Your next step is to choose VM | Settings from the File menu. On the Hardware tab, choose Floppy and browse to your floppy driver (Figure E). Please make sure you tick Connected under the Device Status or you will not be able to load your floppy driver. Click OK.

Figure E

clip_image010 Now, click Yes to load additional drivers (Figure D). The floppy driver is mounted and ready for us to choose by browsing, as shown in Figure F, to the Floppy Disk Drive (A:). Select vmscsi and choose open. BINGO, we have passed the hardware requirements and you can now begin the Windows Home Server Setup.

Figure F

clip_image012 Figure G through Figure N show you the basic process of installing Windows Home Server by using the wizard.

Figure G

clip_image014

Figure H

clip_image016

Figure I

clip_image018

Figure J

clip_image020

Figure K

clip_image022

Figure L

clip_image024

Figure M

clip_image026

Figure N

clip_image028 On the last screen of the initial installation (Figure O), you are prompted to select Start. After you do so, the install process begins, and at some point the machine will reboot. If you receive the error message NTLDR is missing, as shown in Figure P, it is because you did not deselect the floppy image from connecting on the reboot.

Figure O

clip_image030

Figure P

clip_image032 Figure Q shows you how to correct this issue. Simply select VM | Settings from the File menu. On the Hardware tab, choose Floppy and deselect Device Status | Connected | Connected at Power On. Click OK and restart your virtual machine.

Figure Q

clip_image034 As far as I am concerned, this is the trickiest part of the tutorial. During the reboot, you need to press F6 and reload the SCSI driver again. If you fail to press F6, you will get a BSOD (BLUE SCREEN OF DEATH). When you hit F6, you will be presented with Figure R to specify the SCSI driver.

Figure R

clip_image036 You must again choose VM | Settings from the File menu. On the Hardware tab, choose Floppy and check the Device Status | Connected (Figure S). Next press the “S” key on your keyboard and press Enter to load the SCSI driver, as shown in Figure T.

Figure S

clip_image038

Figure T

clip_image040 Next, press Enter to select the VMware SCSI controller (Figure U) and press Enter (Figure V) to continue with the installation.

Figure U

clip_image042

Figure V

clip_image044 Note: During the reboot, if you receive the Ntdlr missing error (Figure W), remember to choose VM | Settings from the File menu. On the Hardware tab, choose Floppy and deselect Device Status | Connected | Connected at Power On and restart the VM again. You can now go to Starbucks and get a CafĂ© Mocha, because you deserve it. Sit back and let the install of Windows Home Server complete.

Figure W

clip_image046 Once the installation is complete, you are presented with a Welcome Screen. After you configure a password and are on the Desktop, choose VM | Install VMware Tools from the File menu (Figure X). And last but not least, don’t forget to download and install Windows Home Server Power Pack 1 as shown in Figure Y.

Figure X

clip_image048

Figure Y

clip_image050

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS