Pages

Thursday, December 16, 2010

Connection String for SQL Server 2008

.NET Framework Data Provider for SQL Server
Type:    .NET Framework Class Library
Usage:  System.Data.SqlClient.SqlConnection

#Standard Security

Data Source=myServerAddress;Initial Catalog=myDataBase;UserId=myUsername;Password=myPassword;

Use serverName\instanceName as Data Source to connect to a specific SQL Server instance. Are you using SQL Server 2008 Express? Don't miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server Express installation resides.

#Connect via an IP address

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server.

Sumber: http://www.connectionstrings.com

Friday, December 3, 2010

Membandingkan Selisih Nilai pada DataGridView

Ilustrasi Tabel Nilai


Ilustrasi Tabel Hasil

Diilustrasikan terdapat sebuah tabel yang akan kita hitung selisih perbandingan dari masing-masing entitas berdasarkan masing-masing kriteria penilaian, yaitu Tabel Nilai. Tabel Nilai berisi skor penilaian masing-masing karyawan terhadap masing-masing kriteria penilaian, yaitu IQ, EQ, dan Penampilan sedangkan Tabel Hasil menampilkan hasil perhitungan selisih skor berdasarkan salah satu kriteria yang telah dipilih (terlihat kriteria yang dipilih pada gambar adalah IQ) dengan membandingkan dari setiap karyawan dimana tabel-tabel tersebut ditampilkan dalam bentuk DataGridView. Jadi, ada DataGridView untuk menampilkan Tabel Nilai (sebut saja DGVNilai) dan ada DataGridView untuk menampilkan Tabel Hasil (sebut saja DGVHasil).

Ilustrasi perhitungan dari Tabel Hasil sebagai berikut:
Skor penilaian dari Pegawai-1 akan dibandingkan dengan skor nilai dari masing-masing pegawai yang lain, yaitu dimulai dari Pegawai-1, Pegawai-2, Pegawai-3, Pegawai-4, dan terakhir Pegawai-5. Skor nilai dari Pegawai-1 untuk IQ adalah 2 kemudian dari skor tersebut akan kita kurangkan dengan skor nilai dari masing-masing pegawai lain. Untuk membandingkan dengan skor nilai Pegawai-1 dengan Pegawai-2 kita mengurangkan 2-5 = -3, lanjut ke Pegawai-3 dengan 2-4 = -2, dan seterusnya.

Berikut ini adalah syntax programnya:
'---
Dim H, N, col As Integer

'col adalah index kolom pada Tabel Nilai
col = ComboBox1.SelectedIndex + 1
   For T As Integer = 1 To DGVHasil.Columns.Count - 1
      N = DGVNilai.Rows(T - 1).Cells(col).Value
         For W As Integer = 0 To DGVNilai.Rows.Count - 1
            H = N - DGVNilai.Rows(W).Cells(col).Value
            DGVHasil.Rows(W).Cells(T).Value = H
         Next 'Baris berikutnya pada DGVNilai
   Next 'Kolom berikutnya pada DGVHasil
'---

Tampilan Aplikasi

Tuesday, August 31, 2010

Bulding Graphical MIDlets

Numeric Color Component Values




Lines
Dipakai untuk menggambar garis.
Syntax: 
drawLine(int x1, int y1, int x2, int y2)
dimana x1, y1 adalah starting point dan x2, y2 adalah ending point.

Contoh:

public void paint(Graphics g) {
g.drawLine(5, 10, 15, 55);
}


Rectangles
Dipakai untuk menggambar persegi atau persegi panjang.

Syntax: drawRect(int x, int y, int width, int height)

Contoh:

public void paint(Graphics g) {
g.drawRect(5, 10, 15, 55);
}


Arcs
Dipakai untuk menggambar sudut.

Syntax: drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)


Contoh:

public void paint(Graphics g) {
g.drawArc(5, 10, 150, 75, 95, 115);
}


Drawing Text
Dipakai untuk menambahkan teks.

Syntax: setFont(Font font)


Font getFont(int face, int style, int size)



The font face must be one of the following values: FACE_SYSTEM, FACE_MONOSPACE, or FACE_PROPORTIONAL.
The style of font must be one of the constants I mentioned earlier: STYLE_PLAIN or a combination 
of STYLE_BOLD, STYLE_ITALIC, and STYLE_UNDERLINED. T
he font size is specified 
as one of the following predefined constants: SIZE_SMALL, SIZE_MEDIUM, or SIZE_LARGE.


Contoh:

Font myFont = Font.getFont(Font.MONOSPACE, Font.LARGE, Font.BOLD | Font.UNDERLINED);


drawString(String str, int x, int y, int anchor)


An anchor point is associated with a horizontal constant and a
vertical constant, each of which determines the horizontal and vertical positioning of the 
text with respect to the anchor point. The horizontal constants used to describe an anchor 
point are LEFT, HCENTER, and RIGHT. One of these constants is combined with a vertical 
constant to fully describe an anchor point. The vertical constants are TOP, BASELINE, and 
BOTTOM.

Contoh:

g.drawString(“Look up here!”, getWidth() / 2, 0, Graphics.HCENTER | Graphics.TOP);


Drawing Images
 Dipakai untuk menambahkan image atau picture.
Contoh:
public void paint(Graphics g) {
// Clear the display

g.setColor(255, 255, 255); // White
g.fillRect(0, 0, getWidth(), getHeight());


// Create and load the image

Image img = Image.createImage(“Bull.png”);


// Draw the image

g.drawImage(img, getWidth()/2, getHeight()/2,

Graphics.HCENTER|Graphics.VCENTER);
}


Sumber: Sams Teach Yourself: Wireless Java With J2ME in 21 Days

Tuesday, August 24, 2010

MIDP-Specific Classes and Interfaces

This portion of the MIDP API is divided among several packages, all of which are prefixed with the javax.microedition name:
• javax.microedition.midlet
• javax.microedition.lcdui
• javax.microedition.io
• javax.microedition.rms

The javax.microedition.midlet Package
The javax.microedition.midlet package is the central package in the MIDlet API, and contains only one class: the MIDlet class. The MIDlet class provides the basic functional overhead required of a MIDP application (MIDlet) that can execute on a mobile device.

The javax.microedition.lcdui Package
The javax.microedition.lcdui package includes classes and interfaces that support GUI components that are specially suited for the small screens found in mobile devices.
Following are the interfaces defined in this package:
Choice—An interface that describes a series of items from which the user can
choose.
CommandListener—An event listener interface for handling high-level commands.
ItemStateListener—An event listener interface for handling item state events.

In addition to these interfaces, also several classes are in the javax.microedition.lcdui package:
Alert—A screen that displays information to the user, and then disappears.
AlertType—Represents different types of alerts used with the Alert class.
Canvas—A low-level drawing surface that allows you to draw graphics on the screen.
ChoiceGroup—Presents a group of selectable items; used in conjunction with the Choice interface.
Command—Represents a high-level command that can be issued from within a MIDlet.
DateField—Presents a date and time so that it can be edited.
Display—Represents a mobile device’s display screen, and also handles the retrieval of user input.
Displayable—An abstract component that is capable of being displayed; other GUI components subclass this class.
Font—Represents a font and its associated font metrics.
Form—A screen that serves as a container for other GUI components.
Gauge—Displays a value as a percentage of a bar graph.
Graphics—Encapsulates two-dimensional graphics operations such as drawing lines, ellipses, text, and images.
Image—Represents a graphical image.
ImageItem—A component that supports the layout and display of an image.
Item—A component that represents an item with a label.
List—A component consisting of a list of choices that can be selected.
Screen—Represents a full screen of high-level GUI information, and serves as the base class for all MIDP GUI components.
StringItem—A component that represents an item consisting of a label and an associated string of text.
TextBox—A type of screen that supports the display and editing of text.
TextField—A component that supports the display and editing of text; unlike TextBox, this component can be placed on a form with other components.
Ticker—A “ticker tape” component that displays text moving horizontally across the display.


The javax.microedition.io Package
CLDC lays the groundwork for networking and I/O with the java.io package and the Generic Connection Framework (GCF). The MIDP API builds on this support with the addition of the HttpConnection interface, which is included in the javax.microedition.io package. The HttpConnection interface solidifies the GCF with support for an HTTP connection, which is useful for accessing Web data from within a MIDlet.

The javax.microedition.rms Package
Because few mobile devices have hard drives or any tangible file system, you probably won’t rely on files to store away persistent MIDlet data. Instead, the MIDP API describes an entirely new approach to store and retrieve persistent MIDlet data: the Record Management System (RMS). The MIDP RMS provides a simple record-based database API for persistently storing data. The classes and interfaces that comprise the RMS are all located in the javax.microedition.rms package.
Following are the RMS interfaces found in this package:
RecordComparator—An interface used to compare two records.
RecordEnumeration—An interface used to iterate through records.
RecordFilter—An interface used to filter records according to certain criteria.
RecordListener—An event listener interface used to handle record change events.
In addition to these interfaces, a few classes fit into the RMS architecture. Most importantly, the RecordStore class represents a record store, which is essentially a simplified database for MIDlet data storage.

The following classes are included in the javax.microedition.rms package:
InvalidRecordIDException—Thrown whenever an operation fails because the record ID is invalid
RecordStore—Represents a record store
RecordStoreException—Thrown whenever an operation fails because of a general exception
RecordStoreFullException—Thrown whenever an operation fails because the record store is full
RecordStoreNotFoundException—Thrown whenever an operation fails because the record store cannot be found
RecordStoreNotOpenException—Thrown whenever an operation is attempted on a closed record store


Sumber: Sams Teach Yourself: Wireless Java With J2ME in 21 Days

Saturday, August 21, 2010

Menggunakan Eclipse Untuk Pengembangan Aplikasi Handphone Berbasis Java ME

Berikut adalah yang kita perlukan jika ingin mengembangkan aplikasi mobile berbasis Java ME dengan Eclipse:

Hal basis yang kita perlukan untuk mengembangkan aplikasi mobile menggunakan Java. Java SE SDK memberikan fungsi-fungsi dasar yang dibutuhkan oleh Java ME.
SDK ini hal yang wajib diinstal jika ingin mengembangkan aplikasi mobile berbasis Java. SDK ini selain menyediakan fungsi-fungsi untuk pengembangan aplikasi mobile juga menyediakan emulator untuk dapat menjalankan program yang sudah kita buat secara simulasi di komputer desktop.
Eclipse Pulsar, bagi yang sudah sering menggunakan Eclipse untuk mengembangkan aplikasi Java desktop, pasti tidak akan terlalu susah untuk beradaptasi dengan IDE yang satu ini. Eclipse Pulsar dibuat berbasis pada framework Eclipse. Eclipse Pulsar merupakan jembatan antara Java ME SDK dengan programmer. Saya menggunakan Eclipse Europa versi 3.3.2 karena belum terbiasa menggunakan Eclipse Pulsar. Namun, saya sarankan lebih baik menggunakan Eclipse Pulsar karena fitur-fiturnya terbarunya lebih baik daripada Eclipse Europa versi 3.3.2.

 
Langkah instalasi tool pengembangan aplikasi mobile berbasis Java ME:
1. Install Java SE SDK versi terbaru, ikuti petunjuk yang diberikan ketika melakukan proses instalasi.
2. Install Java ME SDK, ikuti petunjuk yang diberikan ketika melakukan proses instalasi.

Setelah kita menginstalasi segala yang kita butuhkan, sekarang saatnya kita mengkonfigurasikan Eclipse Europa versi 3.3.2 agar dapat menggunakan Java ME SDK, berikut adalah langkah-langkahnya:

1. Pilih menu Window>Preferences>J2ME>Device Management, di sini anda akan melihat interface mengenai perangkat emulator yang dapat digunakan untuk membuat aplikasi mobile. Awalnya daftar ini masih kosong oleh karena itu kita akan mengimpornya.



 2. Klik tombol Import lalu cari folder dimana anda menginstall Java ME SDK di komputer Anda dengan mengklik tombol Browse biasanya terletak pada folder root C:\WTK***.


3. Eclipse akan mendeteksi semua emulator yang ditemukan pada folder tersebut dan memberikan daftar emulator kemudian klik Finish.


4. Kita akan kembali lagi pada window Preferences kemudian klik OK.


Langkah pengkonfigurasian di atas dimaksudkan agar kita dapat mengemulasikan aplikasi mobile yang sudah kita buat pada komputer desktop. Sekarang kita sudah selesai mengkonfigurasi lingkungan pengembangan yang kita butuhkan untuk membangun aplikasi mobile.

Cara Membuka File Project JAVA ME di Eclipse Europa

Jika Anda sering menggunakan Eclipse Europa sebagai salah satu IDE tool selain NetBeans untuk membuat project Java ME tentunya bingung ketika akan membuka file project JAVA ME yang tersimpan di media penyimpanan seperti flashdisk.

Berikut ini adalah langkah-langkah membuka file project JAVA ME di Eclipse Europa:

1. Pada tab Package Explorer di sebelah kiri dari window editor klik kanan kemudian pilih menu Import.


2. Pada window Select Import Source kemudian pilih Existing Projects into Workspace.


3. Pada textbox Select root directory klik tombol Browse kemudian cari letak folder dimana Anda menyimpan  file project JAVA ME kemudian klik OK.


4. Anda akan kembali pada window Select Import Source, jangan lupa untuk memberi tanda centang pada checkbox Copy project into workspace agar file project J2ME Anda juga disimpan pada folder workspace Eclipse.


5. File project JAVA ME Anda kini telah muncul pada tab Package Explorer dan Anda dapat meng-edit coding pada window editor di sebelah kanan.

Friday, July 23, 2010

Memberi Warna Baris Pada DataGridView

Coding berikut ini untuk memberi warna background baris pada DataGridView berdasarkan nilai atau teks tertentu yang terdapat pada cell.

For Each row As DataGridViewRow In DataGridView1.Rows
  If Not row.IsNewRow Then
    If Not row.Cells(1).Value Is DBNull.Value Then
      If row.Cells(1).Value = "Yes" Then
        row.DefaultCellStyle.BackColor = Color.Red
      End If
    End If
  End If
Next

Tuesday, July 13, 2010

Manghapus dan Menambah Item Pada ListView

Contoh coding untuk menambah item:
' Adds a new item with ImageIndex 3
ListView1.Items.Add("List item text", 3)


Contoh coding untuk menghapus item:
' Removes the first item in the list
ListView1.Items.RemoveAt(0)
' Clears all items:
ListView1.Items.Clear()

Saturday, July 10, 2010

Conversion From Type 'DBNull' to Type 'String' is Not Valid

Suatu saat kita tentu pernah berhadapan dengan pesan exception seperti pada gambar berikut:


Pesan tersebut muncul ketika kita akan menampilkan data dimana baris record tersebut pada salah satu field-nya berisi nilai 'null' alias tidak terdapat data. Agar pesan exception tersebut tidak muncul lagi pastikan bahwa semua field berisi data dan tidak ada yang kosong alias 'null'. Cara lainnya adalah dengan menggunakan IsDBNull. Contoh pemakaian perintah IsDBNull seperti pada syntax di bawah ini:

cn.Open()
comm.Connection = cn
comm.CommandType = CommandType.Text
comm.CommandText = "select * from test where kolom1 = '888'"
dr = comm.ExecuteReader
    If dr.Read Then
         If IsDBNull(dr!kolom2) Then
             TextBox1.Text = ""
         Else
             TextBox1.Text = dr!kolom2
         End If
     End If

Pada syntax di atas jika terdapat nilai 'null' pada kolom2, maka pada TextBox1 akan tampil kosong dan sebaliknya, jika terdapat data akan menampilkan isi dari field kolom2.

Friday, July 9, 2010

Kapan Menggunakan ExecuteReader, ExecuteNonQuery, ExecuteScalar

SqlClient namespace in ADO.NET provides 3 basic methods to run queries with SqlCommand against MSSQL:

    * ExecuteReader
    * ExecuteNonQuery
    * ExecuteScalar

.NET Framework is around for 5 years already now, but these 3 methods are among the most misused in application development. The problem is that ExecuteReader will work for every query via SqlCommand, so most people use it everywhere. The direct result - slow and non-scalable solution. Other results include database bottlenecks, locks and connection leaks.


ExecuteReader

Do not use: when database query is going to provide for sure exactly 1 record. It may be getting record by its id (which is PK in the database) - GetOrderById and such. In this case use ExecuteNonQuery with output parameters.

Use: when database query is going to provide a set of records. It may be search or report.

ExecuteNonQuery

Use: when we are talking about a single database record - in Update, Insert, Delete and Get by Id. In all these cases we can use input/output/input-output parameters. Please note that from the application architecture point of view it is also good practices when your Insert and Update stored procedure returns changed record exactly like Get By Id method does.

ExecuteScalar

Do not use: when database query returns a single value and this value can be defined as parameter in T-SQL. ExecuteNonQuery with output parameter(s) is always preferred in this case since it is more flexible, tomorrow there will be 2 values therefore having ExecuteNonQuery we do not need to change method signatures.

Use: when database query returns a single value and this value cannot be defined as output parameter, because of T-SQL type limitation for variables. For example type image cannot be output parameter in MSSQL.

The most common example for ExecuteScalar is fetching a single image stored in the database and converting it to array of bytes. If you google it - most examples will demonstrate using of ExecuteReader to accomplish image handler, however ExecuteScalar will be more scalable and faster.

Conclusion

Always use ExecuteNonQuery except: when you have a set of records - use ExecuteReader and when you have a single output value that cannot be defined as a parameter - use ExecuteScalar.

Saturday, July 3, 2010

Try … Catch Pada VB .NET

VB.NET memiliki kelas inbuilt yang berhubungan dengan errors. Kelas ini disebut Exception. Ketika error exception ditemukan, objek Exception dibuat. Struktur coding pada VB.NET untuk menangani error dengan Exception tersebut disebut struktur Try ... Catch.

Try


Catch ex As Exception


Finally


End Try


Kata Try berarti "Coba jalankan code ini". Kata Catch berarti "Tangkap semua error di sini". Sedangkan variabel ex, dan tipe variabel itu adalah sebuah objek Exception. Ketika program Anda dijalankan, VB akan mencoba mengeksekusi semua code pada bagian Try. Jika program berjalan dengan baik, bagian Catch akan dilewatkan. Sebaliknya, jika terjadi sebuah error, VB.NET akan menuju langsung ke Catch. Tambahkan baris berikut ke bagian Catch:

MsgBox(ex.Message)

Jika program dijalankan dan terjadi error, maka pesan error tersebut akan muncul sebagai message box dan tidak berupa pesan error seperti berikut:


Bagian Finally akan selalu dijalankan, walaupun terjadi error atau tidak. Biasanya bagian Finally berisi coding untuk membersihkan layar atau menutup koneksi/file yang telah terbuka.

Thursday, July 1, 2010

Membuat Grafik Pada Visual Basic 2008

Untuk membuat grafik pada VB NET bisa melalui laporan (report) atau melalui form. Saya akan mengajarkan menampilkan grafik pada form VB .NET menggunakan komponen Microsoft Chart Control 6.0 (SP4) (OLEDB).

Langkah-langkah membuat grafik pada form sebagai berikut:
1. Buka sebuah project lalu tambahkan sebuah form baru.
2. Pada menu Tools pilih Choose Toolbox Items.


3. Pada window Choose Toolbox Items masuk ke tab COM Components lalu centang Microsoft Chart Control 6.0 (SP4) (OLEDB), klik OK.


4. Pada Toolbox sudah terdapat komponen Microsoft Chart Control 6.0 (SP4) (OLEDB), pillih, lalu tambahkan pada form Anda.


5. Sekarang form Anda telah terdapat komponen tampilan grafik dan langkah selanjutnya adalah membuat coding untuk menampilkan grafik tersebut.

Beberapa atribut dasar yang terdapat pada AxMSChart:
.chartType untuk menentukan tipe/jenis tampilan grafik
.ColumnCount untuk menentukan jumlah grafik atau perbandingan tampilan grafik
.RowCount untuk menentukan berapa banyak baris data angka/nilai yang akan ditampilkan pada grafik
.ColumnLabel untuk menampilkan label pada kolom grafik
.RowLabel untuk menampilan label pada baris angka/nilai grafik
.Data untuk menentukan nilai dari data grafik baik untuk kolom maupun baris
.Row untuk menentukan baris
.Column untuk menentukan kolom

Berikut ini adalah contoh coding untuk menampilkan grafik:

Dim T As Integer

'Tentukan jenis tampilan grafik
AxMSChart1.chartType = MSChart20Lib.VtChChartType.VtChChartType2dBar
AxMSChart1.RowCount = 5 'Menentukan jumlah baris adalah 5
AxMSChart1.ColumnCount = 2 'Menentukan jumlah grafik adalah 2

'Perulangan
For T = 1 To AxMSChart1.RowCount 'Here it is dynamically and will work in all cases of values for AxMSChart1.Row

'Set that we want to edit the row "T"
AxMSChart1.Row = T

'Setting it's label to T
AxMSChart1.RowLabel = T

'Memanipulasi grafik 1
AxMSChart1.Column = 1 'Set that I want to edit the first graph
AxMSChart1.Data = T * 20

'Memanipulasi grafik 2
AxMSChart1.Column = 2 'Set that I want to edit the second graph
AxMSChart1.Data = T * 15
Next

Jika Anda ingin membuat grafik perbandingan antara satu grafik dengan grafik yang lain buatlah jumlah kolomnya (column) lebih dari 1 sesuaikan dengan jumlah perbandingan grafik. Jangan pusing @_@ dengan istilah kolom (column) dan baris (row) pada grafik. Kalian bisa lihat pada tampilan form Grafik Penjualan di bawah ini. Baris (row) ditunjukkan dengan angka 1 s.d. 5 pada sumbu X sedangkan kolom terlihat pada banyaknya grafik di salah satu baris (misalnya baris 1 terdapat dua grafik yaitu grafik hijau dan grafik merah berarti ada 2 kolom).

Tampilan grafik dari coding di atas:

Wednesday, June 30, 2010

Menghitung Jumlah Total Nominal Pada DataGridView

Fungsi berikut untuk menghitung Total_Belanja pada DataGridView:

Private Sub Hitung()
   Dim totalbelanja As Long
   totalbelanja = 0
   For t As Integer = 0 To DataGridView1.Rows.Count - 1
      totalbelanja = totalbelanja + Val(DataGridView1.Rows(t).Cells(index).Value)
   Next
   Label1.Text = totalbelanja
End Sub

Mengubah Ukuran Kertas dan Orientasi Laporan Pada Crystal Report

Seringkali kita ingin mendesain laporan dengan orientasi landscape atau ukuran kertas tertentu. Berikut ini adalah langkah-langkahnya. Pada jendela Visual Basic 2008 pilih menu Crystal Reports kemudian pilih Design lalu Printer Setup. Pada kotak dialog Print Setup pilih Orientation lalu ubah menjadi Portrait/Landscape kemudian OK. Pada kotak dialog Print Setup pilih Paper kemudian ubah ukuran kertas lalu OK.

Window Visual Basic 2008

Kotak Dialog Print Setup

Tuesday, June 29, 2010

Navigasi Record Pada VB 2008

Navigasi record adalah berpindah antara record satu ke record yang lainnya (bisa next, previous, first, last). Kunci utama dari syntax navigasi record terletak pada row index. Misalkan kita membuat sebuah subroutine dengan nama NavigasiRecord() seperti di bawah ini:

Private Sub NavigasiRecord()
     txtFirstName.Text = ds.Tables("AddressBook").Rows(inc).Item(1)
     txtSurname.Text = ds.Tables("AddressBook").Rows(inc).Item(2)
End Sub

Syntax untuk navigasi menuju record selanjutnya adalah:

If inc <> MaxRows - 1 Then
     inc = inc + 1
     NavigasiRecord()
Else
     MsgBox("Tidak ada record.")
End If

Syntax untuk navigasi record sebelumnya adalah:


If inc > 0 Then
     inc = inc - 1
     NavigasiRecord()
ElseIf inc = -1 Then
     MsgBox("Tidak ada records.")
ElseIf inc = 0 Then
     MsgBox("Record pertama.")
End If


Syntax untuk navigasi record menuju record terakhir adalah:

If inc <> MaxRows - 1 Then
     inc = MaxRows - 1
     NavigasiRecord()
End If

Syntax untuk navigasi menuju record pertama adalah:

If inc <> 0 Then
     inc = 0
     NavigasiRecord()
End If

Sunday, June 27, 2010

Router Port Forwarding

This section was will show you how to forward ports you’ve just opened to your router. Since I don’t own every router in existence, I’ll show you what it takes for the LinksysWireless Broadband Router to have ports forwarded to it. The concept is the same for all routers and once you familiarize yourself with the steps, you should be able to navigate through your router settings with ease.

First you need to access your router. Open your web browser then type 192.168.1.1 in the address bar. A user name and password box should appear like the one below.


The factory password for this router is admin, leave the user name blank. Some routers may be admin as the user name with the password area blank. Check the documentation that came with your router or refer yourself to the company website to figure out what this is for your router.
NOTE: Highly recommend you changing that password from the factory setting ASAP if it still exists.

Once you type your password, the router settings should be displayed. Select Application & Gaming.


This screen is very easy to handle once you get familiar with it.


  • Application: Input a small abbreviation so you know what program you’re forwarding the ports for.
  • Start to End: A program will need a range of ports forwarded (i.e. 21000-21005). Under start, type the initial port and under end type the last port of the range.
  • Protocol: Select the one that the port utilizes.
  • IP Address: Type your computer IP address. Like was saying before; you complete this process and reboot your PC, the IP might change (Dynamic IP). Therefore, this setting would not be accurate and your ports will no longer be forwarded. Please use static IP Address in this case.
  • Enable: Self Explanatory.
Here is one good thing about the forwarding part. Let’s say you have a range of 10 consecutive ports to forwards (1100 – 1110). For the router settings you just type the start and finish but you’ll have to do each individual one and if the selection is both for all, you just doubled your work. No biggie, right?!

Save your settings and restart your system.
 

Blogger news

About Me

Palembang, Sumatera Selatan, Indonesia
Seorang yang ingin terus belajar.