Membuat Table Database Mysql Dengan VB.Net

Posted by Unknown Minggu, 03 November 2013 0 komentar
Dalam tutorial ini, saya akan menunjukkan kepada Anda bagaimana membuat tabel database MySQL dinamis dengan cara yang sederhana. Untuk memulai, kita perlu memahami konsep membuat tabel database MySQL. Perintah pembuatan tabel memerlukan berikut: Nama Table, Nama Fields dan Definisi untuk masing-masing Field. Sintaks untuk membuat tabel MySQL adalah seperti yang ditunjukkan di bawah ini :
CREATE TABLE table_name (column_name column_type);
Mari kita mulai membangun aplikasi kita. Pertama buka Visual Basic klik untuk membuat proyek baru (new Project) buat Nama sebagai "tblcreator". Setelah membuat proyek baru, kita akan menambahkan objek untuk mendisain applikasi adalah sebagai berikut : tiga Label, tiga Tombol, dua Combobox, satu Textbox, satu Datagridview dan Groupbox. Kemudian mengatur semua objek seperti yang ditunjukkan di bawah ini.

Selanjutnya, untuk datagridview1 kita perlu menambahkan 6 kolom, dan ini isi kolom tersebut: Field, type, Length/Values, Null, Index and Auto.
Berikut pengaturan untuk kolom datagridview :
Selected Columns	Properties		Settings
Field Header Text Field
DatapropertyName n_field
Name n_field
ColumnType DataGridViewTextBoxColumn
type Header Text type
DatapropertyName n_type
Name n_type
ColumnType DataGridViewComboBoxColumn
Items INT
VARCHAR
TEXT
DATE
Lenght/Values Header Text Lenght/Values
DatapropertyName n_Lenght
Name n_Lenght
ColumnType DataGridViewTextBoxColumn
NULL Header Text Null
DatapropertyName n_null
Name n_null
ColumnType DataGridViewCheckBoxColumn
Truevalue NOT NULL
Falsevalue NULL
Index Header Text Index
DatapropertyName n_index
Name n_index
ColumnType DataGridViewComboBoxColumn
Items PRIMARY KEY
UNIQUE
INDEX
FULLTEXT
Auto Increment Header Text Auto Increment
DatapropertyName n_ai
Truevalue AUTO_INCREMENT
Name n_ai
ColumnType DataGridViewCheckBoxColumn

Setelah kita mengatur kolom datagriview, berikut adalah beberapa item perlu penjelasan :

• NOT NULL digunakan karena kita tidak ingin bidang ini menjadi NULL. Jadi jika pengguna akan mencoba untuk menginput dengan nilai NULL, maka MySQL akan meningkatkan kesalahan.
• AUTO_INCREMENT memberitahu MySQL untuk terus maju dan menambahkan nomor yang tersedia di sebelah kolom id.
• PRIMARY KEY digunakan untuk mendefinisikan sebuah kolom sebagai kunci primer. Anda dapat menggunakan beberapa kolom dipisahkan dengan tanda koma untuk mendefinisikan primary key.

Kemudian kita tambahkan fungsi untuk aplikasi kita. Untuk melakukan ini, klik dua kali pada form dan tambahkan kode berikut di bawah public class.


'Merupakan pernyataan SQL atau disimpan prosedur untuk mengeksekusi terhadap sumber data.
Dim cmd As New MySqlCommand
Dim da As New MySqlDataAdapter
Public total As Integer
Dim publictable As New DataTable
'menyatakan conn sebagai koneksi dan sekarang akan sambungan baru karena
'itu sama dengan Getconnection Function
Dim con As MySqlConnection = Damconn()

Public Function Damconn() As MySqlConnection
Return New MySqlConnection("server=localhost;user id=root;password=;database=")
End Function

Kemudian, pada Form1_Load tambahkan kode berikut. Ini akan mengisi combobox dengan nama database.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GroupBox1.Text = "Create new table on database "
Dim sql As String = "SHOW DATABASES"
Dim publictable As New DataTable
Try

'bind the connection and query
With cmd
.Connection = con
.CommandText = sql
End With

da.SelectCommand = cmd
da.Fill(publictable)

With cbdb
.DataSource = publictable
.DisplayMember = "Database"
.ValueMember = "Database"
End With

da.Dispose()

Catch ex As Exception
MsgBox(ex.Message)

End Try
con.Clone()

End Sub
Selanjutnya, kita perlu untuk menampilkan semua tabel database MySQL pada combobox disediakan untuk nama tabel didasarkan pada database yang dipilih. Untuk melakukan ini, klik dua kali pada tomol "USE" dan tambahkan kode berikut:
    Private Sub btntest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntest.Click
GroupBox1.Text = "Create new table on database " & cbdb.Text
Dim sql As String = "SHOW TABLES FROM " & cbdb.Text
Dim publictable As New DataTable
Try

'bind the connection and query
With cmd
.Connection = con
.CommandText = sql
End With

da.SelectCommand = cmd
da.Fill(publictable)
' publictable.Rows.Add("Please Select...")
With cbtable
.DataSource = publictable
.DisplayMember = "Tables_in_" & cbdb.Text
.ValueMember = "Tables_in_" & cbdb.Text

End With
' dtgrd.Columns(1).Visible = False
da.Dispose()

Catch ex As Exception
MsgBox(ex.Message)

End Try
con.Clone()

End Sub
Kemudian dalam rangka untuk mengaktifkan tombol "Create", kita harus mengaktifkan tombol "Add". Untuk melakukan hal ini, tambahkan kode berikut:
    txttblName.ReadOnly = False
btnCreateTbl.Visible = True
btnAddtbl.Visible = False
berikutnya, klik dua kali tombol "Create" dan tambahkan kode berikut:
    Private Sub btnCreateTbl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateTbl.Click

Dim field As String
Dim type As String
Dim nlenght As Integer
Dim nNull As String
Dim nIndex As String
Dim nAI As String
Dim alltxt As String
Dim result As Integer

Dim tblAndDB As String = cbdb.Text & "." & txttblName.Text
Dim TBLCREATE As String = "CREATE TABLE " & tblAndDB & " ( "

For i As Integer = 0 To Me.dtgStructNewTbl.Rows.Count - 2

' field.Add(Me.dtgStructNewTbl.Rows(i).Cells("n_field").Value)
field = Me.dtgStructNewTbl.Rows(i).Cells("n_field").Value
type = Me.dtgStructNewTbl.Rows(i).Cells("n_type").Value
nlenght = Me.dtgStructNewTbl.Rows(i).Cells("n_lenght").Value
nNull = Me.dtgStructNewTbl.Rows(i).Cells("n_null").Value
nIndex = Me.dtgStructNewTbl.Rows(i).Cells("n_index").Value
nAI = Me.dtgStructNewTbl.Rows(i).Cells("n_ai").Value

alltxt += field & " " & type & "(" & nlenght & ")" & " " & nNull & " " & nIndex & " " & nAI & "," & vbNewLine

Next
Try
'it removes all the newline and whitespaces
alltxt = alltxt.Substring(0, alltxt.Length - Environment.NewLine.Length)
Dim cleanText As String
'it removes the the last comma ","
cleanText = alltxt.Remove(alltxt.Length - 1)
Dim finalText As String
'combination of finalText with table name and Mysql ENGINE
finalText = TBLCREATE & cleanText & ")ENGINE = MYISAM ;"

con.Open()
With cmd
.Connection = con
.CommandText = finalText
result = cmd.ExecuteNonQuery
If result > 0 Then
MsgBox("No Table has created!")
Else
MsgBox(txttblName.Text & " has created Successfully!")
With Me
.txttblName.ReadOnly = True
.btnCreateTbl.Visible = False
.btnAddtbl.Visible = True
.dtgStructNewTbl.SendToBack()
'.dtgStructNewTbl.Columns.Clear()
End With

End If
End With

Form1_Load(sender, e)

Catch ex As Exception
MsgBox(ex.Message)
End Try
con.Close()
End Sub

Semua tampilan code akan seperti ini . . .
    Imports MySql.Data.MySqlClient
Public Class Form1
'Represents an SQL statement or stored procedure to execute against a data source.
Dim cmd As New MySqlCommand
Dim da As New MySqlDataAdapter
Public total As Integer
Dim publictable As New DataTable
'declare conn as connection and it will now a new connection because
'it is equal to Getconnection Function
Dim con As MySqlConnection = Damconn()

Public Function Damconn() As MySqlConnection
Return New MySqlConnection("server=localhost;user id=root;password=;database=")
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
GroupBox1.Text = "Create new table on database "
Dim sql As String = "SHOW DATABASES"
Dim publictable As New DataTable
Try

'bind the connection and query
With cmd
.Connection = con
.CommandText = sql
End With

da.SelectCommand = cmd
da.Fill(publictable)

With cbdb
.DataSource = publictable
.DisplayMember = "Database"
.ValueMember = "Database"
End With

da.Dispose()

Catch ex As Exception
MsgBox(ex.Message)

End Try
con.Clone()

End Sub

Private Sub btntest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntest.Click
GroupBox1.Text = "Create new table on database " & cbdb.Text
Dim sql As String = "SHOW TABLES FROM " & cbdb.Text
Dim publictable As New DataTable
Try

'bind the connection and query
With cmd
.Connection = con
.CommandText = sql
End With

da.SelectCommand = cmd
da.Fill(publictable)
' publictable.Rows.Add("Please Select...")
With cbtable
.DataSource = publictable
.DisplayMember = "Tables_in_" & cbdb.Text
.ValueMember = "Tables_in_" & cbdb.Text

End With
' dtgrd.Columns(1).Visible = False
da.Dispose()

Catch ex As Exception
MsgBox(ex.Message)

End Try
con.Clone()

End Sub

Private Sub btnAddtbl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddtbl.Click
txttblName.ReadOnly = False
btnCreateTbl.Visible = True
btnAddtbl.Visible = False
End Sub

Private Sub btnCreateTbl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateTbl.Click

Dim field As String
Dim type As String
Dim nlenght As Integer
Dim nNull As String
Dim nIndex As String
Dim nAI As String
Dim alltxt As String
Dim result As Integer

Dim tblAndDB As String = cbdb.Text & "." & txttblName.Text
Dim TBLCREATE As String = "CREATE TABLE " & tblAndDB & " ( "

For i As Integer = 0 To Me.dtgStructNewTbl.Rows.Count - 2

' field.Add(Me.dtgStructNewTbl.Rows(i).Cells("n_field").Value)
field = Me.dtgStructNewTbl.Rows(i).Cells("n_field").Value
type = Me.dtgStructNewTbl.Rows(i).Cells("n_type").Value
nlenght = Me.dtgStructNewTbl.Rows(i).Cells("n_lenght").Value
nNull = Me.dtgStructNewTbl.Rows(i).Cells("n_null").Value
nIndex = Me.dtgStructNewTbl.Rows(i).Cells("n_index").Value
nAI = Me.dtgStructNewTbl.Rows(i).Cells("n_ai").Value

alltxt += field & " " & type & "(" & nlenght & ")" & " " & nNull & " " & nIndex & " " & nAI & "," & vbNewLine

Next
Try
'it removes all the newline and whitespaces
alltxt = alltxt.Substring(0, alltxt.Length - Environment.NewLine.Length)
Dim cleanText As String
'it removes the the last comma ","
cleanText = alltxt.Remove(alltxt.Length - 1)
Dim finalText As String
'combination of finalText with table name and Mysql ENGINE
finalText = TBLCREATE & cleanText & ")ENGINE = MYISAM ;"

con.Open()
With cmd
.Connection = con
.CommandText = finalText
result = cmd.ExecuteNonQuery
If result > 0 Then
MsgBox("No Table has created!")
Else
MsgBox(txttblName.Text & " has created Successfully!")
With Me
.txttblName.ReadOnly = True
.btnCreateTbl.Visible = False
.btnAddtbl.Visible = True
.dtgStructNewTbl.SendToBack()
'.dtgStructNewTbl.Columns.Clear()
End With

End If
End With

Form1_Load(sender, e)

Catch ex As Exception
MsgBox(ex.Message)
End Try
con.Close()
End Sub
End Class

Untuk menguji program ini, tekan "F5"

Baca Selengkapnya ....

Force Saber of Light Apk Android Games Free

Posted by Unknown Sabtu, 02 November 2013 0 komentar
Force Saber of Light Apk Android Games Free
Grab your Saber, activate the concentrated beam and battle! The most powerful weapon in the Universe is back – and now in your pocket! That’s right – the Force Saber of Light is now an app!
Swipe your device through the air and feel the power within as you sway and swing with your futuristic weapon! Engage in battles with your powerful beam – battle to the death and betray your friends, strangers, pets and maybe even your own son!
No one will want to be your father when you unleash your inner-force and change your Saber to suit your personality!
Become a knight of light as your beam responds to your slight movement! Choose between different crystals, each giving your more power and a different colour saber! Swap your hilt for 12 different bars for even more customization of your Force Saber! Even choose the dual-blade if you think you can handle the force!
The Force Saber of Light will make noises as you battle – adding even more tension.
Move your Android device and feel the power from your powerful weapon, have battles with your friends as they download the Force Saber of Light app onto their phones! Watch as your camera flash lights during battles for the ultimate night battle experience!
The Force Saber of Light app is free to download and great fun for the whole family! All ages will love how responsive the Force Saber feels in their hands and they will really feel like a Knight of Light!
Features:
- Choose from various crystals to change the beam’s color with more coming soon!
- Choose from 12 hilts, with more coming soon!
- FEEL your Force Saber – it’s best feeling-saber app!
- Hear different sounds from your Force Saber
- Upload and play your own music into app!
- Flashlight turns on when you hit saber!


Baca Selengkapnya ....

Word Crack Free Apk Android Games Free

Posted by Unknown Jumat, 01 November 2013 0 komentar
Word Crack Free Apk Android Games Free
If you like Angry Words, you’ll love Word Crack, a fast and fun word game to challenge your friends. Who will find the most words in two minutes?
Word Crack is asynchronous and cross-platform. Play against your Facebook friends or against random users of any platform. Besides, there are unlimited simultaneous games!
Form as many words as you can by dragging your fingers across the letters on the board upwards, downwards, backwards, diagonally, etc. Every game has three rounds, and every round, two turns of two minutes each, so you have to be really fast! The winner will be the player who gets a higher score.
You can use the special tile spaces on the board to get more points. And remember to use the Power-Ups to find more words and win more easily!
Word Crack is available in 12 languages: Spanish, American English, British English, Catalan, French, German, Italian, Dutch, Swedish, Portuguese, Brazilian Portuguese and now, also Basque!


Baca Selengkapnya ....

Avast Mobile Security Apk android free

Posted by Unknown 0 komentar
Avast Mobile Security Apk android free
Full-featured & top-rated antivirus/anti-theft security app for your Android!
Download avast! Mobile Security now and you can:
• protect personal data with infected-URL alerts and automatic virus scans;
• stop hackers with the firewall (works on rooted phones only);
• control your phone with anti-theft features via SMS: history wipe, phone lock, siren activation, GPS tracking and many other tools;
• make our security app ‘invisible’, making it extremely hard for thieves to find and disable.
A standalone yet tightly integrated component of avast! Mobile Security, avast! Anti-Theft is the slyest component on the market. Formerly known as Theft Aware, the Anti-Theft portion of avast! Mobile Security has been recommended by leading industry experts that include T-Mobile, N-TV, AndroidPIT, and Android Police.
Why do avast! Free Mobile Security and avast! Anti-Theft need used permissions to fully function? Please read our explanation: http://goo.gl/Xd9VI
avast! Mobile Security
Antivirus
Performs on-demand scans of all installed apps and memory card content, as well as on-access scans of apps upon first execution. Options for scheduling scans, virus definition updates, uninstalling apps, deleting files, or reporting a false-positive to our virus lab.
Privacy Report
Scans and displays (grid) access rights and intents of installed apps, identifying potential privacy risks, so you know how much info you are really providing to each app.
SMS/Call Filtering
Filter calls and/or messages from contact list using set parameters based on day(s) of the week, start time, and end time. Blocked calls redirect to voicemail, while blocked messages are stored via filter log. Also possible to block outgoing calls.
App Manager
Similar to Windows Task Manager, it shows a list of running apps and their size (MB), CPU load, used memory, and number of threads and services – with an option to stop or uninstall.
Web Shield
Part of the avast! WebRep cloud, the avast! Web Shield for Android scans each URL that loads and warns you if the browser loads a malware-infected URL.
Firewall
Add a firewall to stop hackers. Disable an app’s internet access when on WiFi and 3G and roaming mobile networks. (Works only on rooted phones.)
avast! Anti-Theft
App Disguiser
After downloading avast! Anti-Theft, user can choose a custom name that disguises the app (e.g. call it “Pinocchio game”) so that it is even harder for thieves to find and remove.
Stealth Mode
Once anti-theft is enabled, the app icon is hidden in the app tray, leaving no audio or other trace on the target phone – the app is ‘invisible’, making it difficult for thieves to detect or remove.
Self-Protection
Extremely difficult for thieves to remove (especially on rooted phones), Anti-Theft protects itself from uninstall by disguising its components with various self-preservation techniques. On rooted phones it is able to survive hard-resets and can even disable the phone’s USB port.
Battery Save
Anti-Theft only launches itself and runs when it needs to perform tasks. This preserves battery life and makes it very difficult for thieves to shut it down.
SIM-Card-Change Notification
If stolen and a different (unauthorized) SIM card inserted, the phone can lock, activate siren, and send you notification (to remote device) of the phone’s new number and geo-location.
Trusted SIM Cards List
Establish a ‘white list’ of approved SIM cards that can be used in the phone without triggering a theft alert. You can also easily clear the trusted SIM cards list, to leave the one present in the phone as the only trusted one.
Remote Settings Change
A setup wizard guides the user through the installation process on rooted phones. No command-line knowledge is necessary to install Anti-Theft rooted. Also supports upgrading.
Remote Features
SMS commands provide you the following REMOTE options for your ‘lost’ (or stolen) phone:
Siren, Lock, custom Display properties, Locate, Memory Wipe, covert Calling, Forwarding, “Lost” Notification, SMS Sending, History, Restart, and more.


Baca Selengkapnya ....

Bluetooth File Transfer Apk android free

Posted by Unknown 0 komentar
Bluetooth File Transfer Apk
Use your smartphone to browse, explore and manage files of any Bluetooth ready device, using File Transfer Profile (FTP) and Object Push Profile (OPP): you can also receive files and send contacts! BlueX OBEX


Baca Selengkapnya ....

Launcher 8 Apk android free

Posted by Unknown 0 komentar
Launcher 8 Apk

This launcher will make your phone look like Winphone 8.
Current features
- Fly animations like real phone, slightly evolved from L7 fly animation
- Application list also contains fly animation
- Completely redesigned how tiles are defined
- Contains animated tiles: flipping contacts tile, single contact tile, sms counter, calendar
- Phone counter is included, but does not have any animations
- Application list icons can be customized
- Three pages for widgets
Android 4.x highly recommended. 2.x works, but unfortunately it is getting painfully slow.
When you start L8 for the very first time, it will load icon package from the Google’s servers. By default it will not load the package if you are not connected to Wifi network. Enable mobile-button will then allow you to download the package using cellular network. The size of the package is currently about 5 megabytes.
Click restart L8-button after icon package is downloaded and L8 will then start.
Setting tile images is different from L7, now you define a drawable for each tile. Drawable then defines what will be drawn on the tile (icon, picture, calendar,…). Multiple tiles can share same drawable. Also drawables can contain drawables, but currently only single contact tile allows you to nest drawables.
Contans advertisments, you can remove them from the in-app store.

CURRENT VERSION: 1.3-c
REQUIRES ANDROID: 2.1 and up


Baca Selengkapnya ....

Rootkit Revealer standalone Offline installer Download

Posted by Unknown 0 komentar
Rootkit Revealer standalone Offline installer Download Full. It is an advanced and powerful system damager rootkit revealer utility. Efficiently works on Windows NT 4 and above. Besides, the tools output list registry and file system inconsistencies that may imply the presence of kernel-mode or user-mode.


Rootkit Revealer standalone Offline installer Download


Rootkitrevealer amazingly and effectively finds out all most all determined rootkits such as AFX, Vanquish, and hacker defender. But it should be noted that this tool does not intend to detect some rootkits such as Fu that doesn’t attempt to cover their files or registry keys.

This rootkit revealer work by changing API results so that a system view with APIs differ from the real view in storage. Thus it matches the end result of system scan at the fullest term with that of the lowest level.

Here the lowest level is referred to the raw contents of a file system volume or registry hive and the highest level is the Windows API. Here a hive is registry’s on-disk storage format.

Therefore rootkits whether in kernel status or user status, that use effectively the windows API or native to delete their existence from a directory listing. For instance it will be seen as an inconsistency between the information recapped by windows API and seen in the raw scan of a FAT or NTFS volumes’ file.

How to Get Rootkit Revealer standalone Offline installer Download free?

Its not possible to get a offline installer version of this software.
To download RootkitRevealer click here (link) .
The file is only 226 kilobyte. And when you download it, it will be downloaded as zip file. The file is shareware and language is English.

System requirements:
Windows 2000
Windows Xp
Windows Vista
Windows 7 & 8


Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android jones.