Skip to main content

Posts

Showing posts from September, 2013

Koneksi VB .Net Dengan Database Mysql

Koneksi VB .Net Dengan Database Mysql Untuk yang ini anda harus install ODBC MySql terlebih dahulu yang selanjutnya pada Project Anda Add Refernce lalu pilih ODBC MySql Imports MySql.Data.MySqlClient Module Module_koneksi Dim connection As New MySqlClientConection( "server=LOCALHOST; uid=UID; pwd=PASSWORD; database=NAMADATABASE" ) Private Sub connection_open() Try If connection.State <> ConnectionState.Closed Then connection.Close() connection.Open() Catch ex As Exception End Try End Sub Private Sub connection_close() Try If connection.State <> ConnectionState.Open Then connection.Open() connection.Close() Catch ex As Exception End Try End Sub End Module

Koneksi VB .Net Dengan Database Microsoft Accses

Koneksi VB .Net Dengan Database Microsoft Accses Simpan Database Accses anda ke Folder Bin/Debug/NAMADATABASE dalam Poject VB .Net Imports System.Data.OleDb Module Module_koneksi Dim connection As New OleDbConnection( "provider=Microsoft.jet.oledb.4.0;data source=" & Application.StartupPath & "\NAMADATABASE.mdb" ) Private Sub connection_open() Try If connection.State <> ConnectionState.Closed Then connection.Close() connection.Open() Catch ex As Exception End Try End Sub Private Sub connection_close() Try If connection.State <> ConnectionState.Open Then connection.Open() connection.Close() Catch ex As Exception End Try End Sub End Module

Koneksi VB .Net Menggunakan Menggunakan ODBC

Imports System.Data.ODbC Module Module_koneksi Dim connection As New OdbcConnection( "DSN= NAMADSN ;" ) Private Sub connection_open() Try If connection.State <> ConnectionState.Closed Then connection.Close() connection.Open() Catch ex As Exception End Try End Sub Private Sub connection_close() Try If connection.State <> ConnectionState.Open Then connection.Open() connection.Close() Catch ex As Exception End Try End Sub End Module

Cara menyimpan data di vb.net 2008

public function simpan () as integer dim sql as string dim xcmd as sqlcommand dim x as integer sql = "insert into siswa (nis,nama) values (@nis,@nama) xcmd = new sqlcommand (sql,conn) with parameter     .addwithvalue ("nis",Fnis)     .addwithvalue ("nama",Fnama") end with  x  = xcmd.executenonquery return x end function

cara menampilkan data di combobox di vb.net 2008

Buka Vb.net 2008 Pilih  icon combobox yang ada di toolbox

cara membuat hapus data di vb.net 2008

public function hapus data () as integer '--------------------------------------------- 'class untuk menghapus data '--------------------------------------------- dim sql as string dim xcmd as sqlcomand dim x sql ="delete from siswa where nis=@nis" xcmd = new sqlcommand (sql ,con) xcmd.paramater.addwithvalue("nis", Fnis) x = xcmd.executenonquery xcmd.dispose () return x end function

membuat perintah ubah di vb.net

public function ubahdata () as integer      dim sql as string      dim xcmd as sqlcomand      dim x as integer      sql ="update siswa set nm_siswa=@nm_siswa,Jenkel=@jenkel,Alamat=@alamat where      nis=@nis"      xcmd = new slqcomand (sql, con)      with parameter            .addwithvalue("nm_siswa", Fnm_siswa)            .addwithvalue("jenkel",Fjenkel)            .addwithvalue ("nis",Fnis)      end with       x = xcmd.excutenonquery      xcmd.dispose ()      return x end function jangan lupa di class ini yang paling atas harus ditulis import system.data.sqlclient karena jika tidak di tulis maka sqlcommand tidak kebaca maka error. selamat mencoba maaf jika ada kesalahan kata - kata karena penulis baru saja belajar membuat aplikasi ini.

Koneksi Database sqlserver 2005 ke vb.net 2008

Imports System.Data.SqlClient ---------------------------------------------------------------------------------------------------------- Module modulkoneksi     Public mycn As New SqlConnection ----------------------------------------------------------------------------------------------------------     Sub bukaconn()         mycn.ConnectionString = "data source=.\sqlexpress;initial catalog=dbpejualan; integrated security=SSPI"         If mycn.State = ConnectionState.Closed Then             Try                 mycn.Open()             Catch ex As Exception                 MsgBox(ex.Message)                 Application.Exit()             End Try         End If     End Sub End Module --------------------------------------------------------------------------------------------------------- semoga bermanfaat ....