<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for mas anto dotcom</title>
	<atom:link href="http://mas-anto.com/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://mas-anto.com</link>
	<description>Share the Knowledge</description>
	<lastBuildDate>Fri, 13 Apr 2012 08:56:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by Mas Anto</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-224</link>
		<dc:creator>Mas Anto</dc:creator>
		<pubDate>Fri, 13 Apr 2012 08:56:36 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-224</guid>
		<description>silakan download di http://mas-anto.com/download/Clskoneksi</description>
		<content:encoded><![CDATA[<p>silakan download di <a href="http://mas-anto.com/download/Clskoneksi" rel="nofollow">http://mas-anto.com/download/Clskoneksi</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by Programmer Pemula</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-223</link>
		<dc:creator>Programmer Pemula</dc:creator>
		<pubDate>Fri, 13 Apr 2012 02:12:42 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-223</guid>
		<description>Mas, koneksi vb.net ke sql servernya gmana?</description>
		<content:encoded><![CDATA[<p>Mas, koneksi vb.net ke sql servernya gmana?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by Katirefa</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-221</link>
		<dc:creator>Katirefa</dc:creator>
		<pubDate>Mon, 09 Apr 2012 05:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-221</guid>
		<description>Ini script untuk menampilkannya kembali

Imports System.IO
Imports MySql.Data.MySqlClient
Imports System.Object
Imports System.Windows.Forms
Public Class Form2
    Inherits System.Windows.Forms.Form
    Private adapter As MySqlDataAdapter
    Private currFile As String = Nothing
    Dim table As DataTable
    Dim mysqlCmd As MySqlCommand
    Dim CommandText As MySqlCommand
    Dim ds As DataSet
    Dim fs As FileStream
    Sub Tabel()
        With LV1
            .Columns.Add(&quot;KODE&quot;, 0, HorizontalAlignment.Left)
            .Columns.Add(&quot;KATEGORI&quot;, 200, HorizontalAlignment.Left)
            .Columns.Add(&quot;NOMOR&quot;, 75, HorizontalAlignment.Left)
            .Columns.Add(&quot;TAHUN&quot;, 75, HorizontalAlignment.Left)
            .Columns.Add(&quot;TENTANG&quot;, 500, HorizontalAlignment.Left)
            .GridLines = True
            .FullRowSelect = True
            .View = View.Details
        End With
    End Sub
    Sub TampilLV()
        Dim DTLV As MySqlDataReader
        Try
            Conn.Open()
            Dim CC As New MySqlCommand(&quot;select * from MASTER  &quot;, Conn)
            DTLV = CC.ExecuteReader()
            Dim i As Integer = 0
            LV1.Items.Clear()
            While DTLV.Read
                LV1.Items.Add(DTLV(&quot;KODE&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Kategori&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Nomor&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tahun&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tentang&quot;))
                i = i + 1
            End While
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            Conn.Close() &#039; must close after execute
        End Try

    End Sub
    Private Sub FrmKosong()
        ComboBox1.Text = &quot;&quot;
        TextBox1.Text = &quot;&quot;
        TextBox2.Text = &quot;&quot;
        TextBox3.Text = &quot;&quot;
        WebBrowser1.Navigate(&quot;&quot;)
    End Sub
    Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        DataCombo()
        TampilLV()
    End Sub
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Tabel()
    End Sub
    Private Sub LV1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV1.DoubleClick
        With Me
            LBKODE.Text = LV1.SelectedItems(0).SubItems(0).Text
            t4.Text = LV1.SelectedItems(0).SubItems(1).Text
            T1.Text = LV1.SelectedItems(0).SubItems(2).Text
            t2.Text = LV1.SelectedItems(0).SubItems(3).Text
            t3.Text = LV1.SelectedItems(0).SubItems(4).Text
        End With
        ComboBox1.Text = t4.Text
        TextBox1.Text = T1.Text
        TextBox2.Text = t2.Text
        TextBox3.Text = t3.Text
        TampilPdf()
    End Sub
    Sub TampilPdf()
        Dim fs As FileStream = Nothing

        Dim temp As String = &quot;D:\DataSiskumTemp\&quot; + LBKODE.Text

        Dim sql As String = &quot;SELECT * FROM Master WHERE Kode=&#039;&quot; &amp; LBKODE.Text &amp; &quot;&#039;&quot;
        Try
            adapter = New MySqlDataAdapter(sql, Conn)
            ds = New DataSet
            adapter.Fill(ds, &quot;Master&quot;)
            Dim myRow As DataRow

            myRow = ds.Tables(&quot;Master&quot;).Rows(0)

            Dim DataPDF() As Byte
            DataPDF = myRow(&quot;file&quot;)
            Dim Counter As Long

            Counter = UBound(DataPDF)
            fs = New FileStream(temp, FileMode.OpenOrCreate, FileAccess.Write)
            fs.Write(DataPDF, 0, Counter)
            fs.Close()
            adapter.Dispose()

        Catch ex As Exception
            MsgBox(&quot;Error : &quot; + ex.Message)
        Finally
            WebBrowser1.Refresh()
            WebBrowser1.Navigate(temp)
        End Try
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        FrmKosong()
        Tabel()
        TampilLV()
    End Sub
    Sub DataCombo()
        Conn.Open()
        Dim query As String = &quot;SELECT * FROM KTGR&quot;
        Dim DA = New MySqlDataAdapter(query, Conn)
        Dim DS = New DataSet
        DA.Fill(DS, &quot;KTGR&quot;)

        With ComboBox1
            .DataSource = DS.Tables(&quot;KTGR&quot;)
            .DisplayMember = &quot;Kategori&quot;
            .ValueMember = &quot;Nomor&quot;
            .SelectedIndex = 0
        End With
        ComboBox1.Text = &quot;&quot;
        Conn.Close()
    End Sub
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

        Dim DTLV As MySqlDataReader
        Try
            Conn.Close()
            Conn.Open()
            Dim CC As New MySqlCommand(&quot;Select * From MASTER where Kategori Like&#039;%&quot; &amp; ComboBox1.Text &amp; &quot;%&#039;&quot;, Conn)
            DTLV = CC.ExecuteReader()
            Dim i As Integer = 0
            LV1.Items.Clear()
            While DTLV.Read
                LV1.Items.Add(DTLV(&quot;KODE&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Kategori&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Nomor&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tahun&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tentang&quot;))
                i = i + 1
            End While
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            Conn.Close()
        End Try
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        Dim DTLV As MySqlDataReader
        Try
            Conn.Open()
            Dim CC As New MySqlCommand(&quot;Select * From MASTER where Nomor Like&#039;%&quot; &amp; TextBox1.Text &amp; &quot;%&#039;&quot;, Conn)
            DTLV = CC.ExecuteReader()
            Dim i As Integer = 0
            LV1.Items.Clear()
            While DTLV.Read
                LV1.Items.Add(DTLV(&quot;KODE&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Kategori&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Nomor&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tahun&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tentang&quot;))
                i = i + 1
            End While
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            Conn.Close()
        End Try
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Close()
    End Sub
End Class</description>
		<content:encoded><![CDATA[<p>Ini script untuk menampilkannya kembali</p>
<p>Imports System.IO<br />
Imports MySql.Data.MySqlClient<br />
Imports System.Object<br />
Imports System.Windows.Forms<br />
Public Class Form2<br />
    Inherits System.Windows.Forms.Form<br />
    Private adapter As MySqlDataAdapter<br />
    Private currFile As String = Nothing<br />
    Dim table As DataTable<br />
    Dim mysqlCmd As MySqlCommand<br />
    Dim CommandText As MySqlCommand<br />
    Dim ds As DataSet<br />
    Dim fs As FileStream<br />
    Sub Tabel()<br />
        With LV1<br />
            .Columns.Add(&#8220;KODE&#8221;, 0, HorizontalAlignment.Left)<br />
            .Columns.Add(&#8220;KATEGORI&#8221;, 200, HorizontalAlignment.Left)<br />
            .Columns.Add(&#8220;NOMOR&#8221;, 75, HorizontalAlignment.Left)<br />
            .Columns.Add(&#8220;TAHUN&#8221;, 75, HorizontalAlignment.Left)<br />
            .Columns.Add(&#8220;TENTANG&#8221;, 500, HorizontalAlignment.Left)<br />
            .GridLines = True<br />
            .FullRowSelect = True<br />
            .View = View.Details<br />
        End With<br />
    End Sub<br />
    Sub TampilLV()<br />
        Dim DTLV As MySqlDataReader<br />
        Try<br />
            Conn.Open()<br />
            Dim CC As New MySqlCommand(&#8220;select * from MASTER  &#8220;, Conn)<br />
            DTLV = CC.ExecuteReader()<br />
            Dim i As Integer = 0<br />
            LV1.Items.Clear()<br />
            While DTLV.Read<br />
                LV1.Items.Add(DTLV(&#8220;KODE&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Kategori&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Nomor&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tahun&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tentang&#8221;))<br />
                i = i + 1<br />
            End While<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        Finally<br />
            Conn.Close() &#8216; must close after execute<br />
        End Try</p>
<p>    End Sub<br />
    Private Sub FrmKosong()<br />
        ComboBox1.Text = &#8220;&#8221;<br />
        TextBox1.Text = &#8220;&#8221;<br />
        TextBox2.Text = &#8220;&#8221;<br />
        TextBox3.Text = &#8220;&#8221;<br />
        WebBrowser1.Navigate(&#8220;&#8221;)<br />
    End Sub<br />
    Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated<br />
        DataCombo()<br />
        TampilLV()<br />
    End Sub<br />
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Tabel()<br />
    End Sub<br />
    Private Sub LV1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV1.DoubleClick<br />
        With Me<br />
            LBKODE.Text = LV1.SelectedItems(0).SubItems(0).Text<br />
            t4.Text = LV1.SelectedItems(0).SubItems(1).Text<br />
            T1.Text = LV1.SelectedItems(0).SubItems(2).Text<br />
            t2.Text = LV1.SelectedItems(0).SubItems(3).Text<br />
            t3.Text = LV1.SelectedItems(0).SubItems(4).Text<br />
        End With<br />
        ComboBox1.Text = t4.Text<br />
        TextBox1.Text = T1.Text<br />
        TextBox2.Text = t2.Text<br />
        TextBox3.Text = t3.Text<br />
        TampilPdf()<br />
    End Sub<br />
    Sub TampilPdf()<br />
        Dim fs As FileStream = Nothing</p>
<p>        Dim temp As String = &#8220;D:\DataSiskumTemp\&#8221; + LBKODE.Text</p>
<p>        Dim sql As String = &#8220;SELECT * FROM Master WHERE Kode=&#8217;&#8221; &amp; LBKODE.Text &amp; &#8220;&#8216;&#8221;<br />
        Try<br />
            adapter = New MySqlDataAdapter(sql, Conn)<br />
            ds = New DataSet<br />
            adapter.Fill(ds, &#8220;Master&#8221;)<br />
            Dim myRow As DataRow</p>
<p>            myRow = ds.Tables(&#8220;Master&#8221;).Rows(0)</p>
<p>            Dim DataPDF() As Byte<br />
            DataPDF = myRow(&#8220;file&#8221;)<br />
            Dim Counter As Long</p>
<p>            Counter = UBound(DataPDF)<br />
            fs = New FileStream(temp, FileMode.OpenOrCreate, FileAccess.Write)<br />
            fs.Write(DataPDF, 0, Counter)<br />
            fs.Close()<br />
            adapter.Dispose()</p>
<p>        Catch ex As Exception<br />
            MsgBox(&#8220;Error : &#8221; + ex.Message)<br />
        Finally<br />
            WebBrowser1.Refresh()<br />
            WebBrowser1.Navigate(temp)<br />
        End Try<br />
    End Sub<br />
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
        FrmKosong()<br />
        Tabel()<br />
        TampilLV()<br />
    End Sub<br />
    Sub DataCombo()<br />
        Conn.Open()<br />
        Dim query As String = &#8220;SELECT * FROM KTGR&#8221;<br />
        Dim DA = New MySqlDataAdapter(query, Conn)<br />
        Dim DS = New DataSet<br />
        DA.Fill(DS, &#8220;KTGR&#8221;)</p>
<p>        With ComboBox1<br />
            .DataSource = DS.Tables(&#8220;KTGR&#8221;)<br />
            .DisplayMember = &#8220;Kategori&#8221;<br />
            .ValueMember = &#8220;Nomor&#8221;<br />
            .SelectedIndex = 0<br />
        End With<br />
        ComboBox1.Text = &#8220;&#8221;<br />
        Conn.Close()<br />
    End Sub<br />
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged</p>
<p>        Dim DTLV As MySqlDataReader<br />
        Try<br />
            Conn.Close()<br />
            Conn.Open()<br />
            Dim CC As New MySqlCommand(&#8220;Select * From MASTER where Kategori Like&#8217;%&#8221; &amp; ComboBox1.Text &amp; &#8220;%&#8217;&#8221;, Conn)<br />
            DTLV = CC.ExecuteReader()<br />
            Dim i As Integer = 0<br />
            LV1.Items.Clear()<br />
            While DTLV.Read<br />
                LV1.Items.Add(DTLV(&#8220;KODE&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Kategori&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Nomor&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tahun&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tentang&#8221;))<br />
                i = i + 1<br />
            End While<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        Finally<br />
            Conn.Close()<br />
        End Try<br />
    End Sub</p>
<p>    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged<br />
        Dim DTLV As MySqlDataReader<br />
        Try<br />
            Conn.Open()<br />
            Dim CC As New MySqlCommand(&#8220;Select * From MASTER where Nomor Like&#8217;%&#8221; &amp; TextBox1.Text &amp; &#8220;%&#8217;&#8221;, Conn)<br />
            DTLV = CC.ExecuteReader()<br />
            Dim i As Integer = 0<br />
            LV1.Items.Clear()<br />
            While DTLV.Read<br />
                LV1.Items.Add(DTLV(&#8220;KODE&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Kategori&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Nomor&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tahun&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tentang&#8221;))<br />
                i = i + 1<br />
            End While<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        Finally<br />
            Conn.Close()<br />
        End Try<br />
    End Sub</p>
<p>    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
        Close()<br />
    End Sub<br />
End Class</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by Katirefa</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-220</link>
		<dc:creator>Katirefa</dc:creator>
		<pubDate>Mon, 09 Apr 2012 05:36:16 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-220</guid>
		<description>ini script lengkapnya sudah saya lengkapi dan bisa jalan sempurna untuk menyimpan. MySql &amp; VB.NET 2010

Imports System.IO
Imports MySql.Data.MySqlClient
Imports System.Object
Imports System.Windows.Forms
Public Class Form1
    Inherits System.Windows.Forms.Form
    Private adapter As MySqlDataAdapter
    Private currFile As String = Nothing
    Dim table As DataTable
    Dim mysqlCmd As MySqlCommand
    Dim CommandText As MySqlCommand
    Dim ds As DataSet
    Dim fs As FileStream
    Sub Tabel()
        With LV1
            .Columns.Add(&quot;KODE&quot;, 0, HorizontalAlignment.Center)
            .Columns.Add(&quot;KATEGORI&quot;, 100, HorizontalAlignment.Center)
            .Columns.Add(&quot;NOMOR&quot;, 75, HorizontalAlignment.Center)
            .Columns.Add(&quot;TAHUN&quot;, 75, HorizontalAlignment.Center)
            .Columns.Add(&quot;TENTANG&quot;, 500, HorizontalAlignment.Left)
            .GridLines = True
            .FullRowSelect = True
            .View = View.Details
        End With
    End Sub
    Sub TampilLV()
        Dim DTLV As MySqlDataReader
        Try
            Conn.Open()
            Dim CC As New MySqlCommand(&quot;select * from MASTER  &quot;, Conn)
            DTLV = CC.ExecuteReader()
            Dim i As Integer = 0
            LV1.Items.Clear()
            While DTLV.Read

                LV1.Items.Add(DTLV(&quot;KOde&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Kategori&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Nomor&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tahun&quot;))
                LV1.Items(i).SubItems.Add(DTLV(&quot;Tentang&quot;))
                i = i + 1
            End While
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        Finally
            Conn.Close() &#039; must close after execute
        End Try
       
    End Sub
    Private Sub FrmKosong()
        TextBox1.Text = &quot;&quot;
        TextBox2.Text = &quot;&quot;
        TextBox3.Text = &quot;&quot;
        ComboBox1.Text = &quot;&quot;
        WebBrowser1.Navigate(&quot;&quot;)
    End Sub
    Private Sub FrmMati()
        TextBox1.Enabled = False
        TextBox2.Enabled = False
        TextBox3.Enabled = False
        ComboBox1.Enabled = False
    End Sub
    Private Sub FrmHidup()
        TextBox1.Enabled = True
        TextBox2.Enabled = True
        TextBox3.Enabled = True
        ComboBox1.Enabled = True
    End Sub
    Private Sub FrmAwal()
        FrmKosong()
        FrmMati()
        Button1.Text = &quot;Baru&quot;
        Button2.Text = &quot;Edit&quot;
        Button3.Text = &quot;Hapus&quot;
        Button4.Text = &quot;Tutup&quot;
        Button5.Text = &quot;Open Pdf File&quot;
        Button1.Enabled = True
        Button2.Enabled = True
        Button3.Enabled = True
        Button4.Enabled = True
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Tabel()
        TampilLV()
        Conn.Open()
        Dim query As String = &quot;SELECT * FROM KTGR&quot;
        Dim DA = New MySqlDataAdapter(query, Conn)
        Dim DS = New DataSet
        DA.Fill(DS, &quot;KTGR&quot;)
        ComboBox1.Text = &quot;&quot;
        With ComboBox1
            .DataSource = DS.Tables(&quot;KTGR&quot;)
            .DisplayMember = &quot;Kategori&quot;
            .ValueMember = &quot;Nomor&quot;
            .SelectedIndex = 0
            .Text = &quot;&quot;
        End With
        Conn.Close()
        FrmAwal()
        TextBox2.MaxLength = 4
        TextBox1.MaxLength = 4
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ukuran As Integer
        Dim fs As FileStream

        If Button1.Text = &quot;Baru&quot; Then
            Button1.Text = &quot;Simpan&quot;
            Button2.Enabled = False
            Button3.Enabled = False
            Button4.Text = &quot;Batal&quot;
            FrmHidup()
            TextBox1.Focus()
            FrmKosong()
        Else


            If ComboBox1.Text = &quot;&quot; Or TextBox1.Text = &quot;&quot; Or TextBox2.Text = &quot;&quot; Or TextBox3.Text = &quot;&quot; Then
                MsgBox(&quot;Data Belum Lengkap...!&quot;, 48, &quot;Error&quot;)
            Else

                Try
                    fs = New FileStream(currFile, FileMode.Open, FileAccess.Read)
                    ukuran = fs.Length
                    Dim rawData() As Byte = New Byte(ukuran) {}
                    fs.Read(rawData, 0, ukuran)
                    fs.Close()

                    Dim sql As String = &quot;SELECT * FROM MASTER&quot;
                    conn = New MySqlConnection(ConnectionString)
                    conn.Open()

                    adapter = New MySqlDataAdapter(sql, Conn)
                    Dim CmdBuilder As MySqlCommandBuilder = New MySqlCommandBuilder(adapter)
                    Dim ds As DataSet = New DataSet(&quot;MASTER&quot;)
                    adapter.Fill(ds, &quot;MASTER&quot;)
                    Dim row As DataRow = ds.Tables(&quot;MASTER&quot;).NewRow()
                    row(&quot;Kode&quot;) = ComboBox1.Text + TextBox1.Text
                    row(&quot;kategori&quot;) = ComboBox1.Text
                    row(&quot;nomor&quot;) = TextBox1.Text
                    row(&quot;tahun&quot;) = TextBox2.Text
                    row(&quot;tentang&quot;) = TextBox3.Text
                    row(&quot;na_file&quot;) = Path.GetFileName(TPath.Text)
                    row(&quot;ukuran&quot;) = ukuran
                    row(&quot;file&quot;) = rawData
                    ds.Tables(&quot;MASTER&quot;).Rows.Add(row)
                    adapter.Update(ds, &quot;MASTER&quot;)
                    MsgBox(&quot;FIle Sudah Tersimpan&quot;, MsgBoxStyle.Information, &quot;OK&quot;)
                    conn.Close()
                    FrmAwal()
                    TampilLV()
                Catch ex As Exception
                    MsgBox(&quot;Gagal Menyimpan Data Silahkan Mengulang...! &quot; + ex.Message)
                End Try
            End If
        End If
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Button2.Text = &quot;Edit&quot; Then
            Button2.Text = &quot;Simpan&quot;
            Button1.Enabled = False
            Button3.Enabled = False
            Button4.Text = &quot;Batal&quot;
            FrmHidup()
            TextBox1.Focus()
        Else
            If TextBox1.Text = &quot;&quot; Or TextBox2.Text = &quot;&quot; Then
                MsgBox(&quot;Maaf Data Masih Kurang&quot;, 48, &quot;Error&quot;)
            Else
                Conn.Open()
                Dim SQLUbah As String
                SQLUbah = &quot;Update Master Set Kategori=&#039;&quot; &amp; ComboBox1.Text &amp; &quot;&#039;,Nomor=&#039;&quot; &amp; TextBox1.Text &amp; &quot;&#039;,Tahun=&#039;&quot; _
                &amp; TextBox2.Text &amp; &quot;&#039;,Tentang=&#039;&quot; &amp; TextBox3.Text &amp; &quot;&#039;Where Kode=&#039;&quot; &amp; LBKODE.Text &amp; &quot;&#039;&quot;
                Cmd = New MySqlCommand(SQLUbah, Conn)
                Cmd.ExecuteNonQuery()
                MsgBox(&quot;Data Telah Di Ubah&quot;, MsgBoxStyle.OkOnly + MsgBoxStyle.Information, &quot;Sukses&quot;)
                FrmAwal()
                Conn.Close()
                TampilLV()
            End If
        End If
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If TextBox1.Text = &quot;&quot; Then
            MsgBox(&quot;Maaf Tidak ada data yang akan dihapus&quot;, 48, &quot;Perhatian&quot;)
        Else
            Dim Pesan As String
            Pesan = MsgBox(&quot;Yakin akan dihapus&quot;, MsgBoxStyle.YesNo, &quot;Konfirmasi&quot;)
            If Pesan = vbYes Then
                Conn.Open()
                Dim SQLHapus As String
                SQLHapus = &quot;Delete  From Master Where Kode=&#039;&quot; &amp; LBKODE.Text &amp; &quot;&#039;&quot;
                Cmd = New MySqlCommand(SQLHapus, Conn)
                Cmd.ExecuteNonQuery()
                Conn.Close()
                FrmAwal()
                TampilLV()
            End If
        End If
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Select Case Button4.Text
            Case &quot;Tutup&quot;
                Close()
            Case &quot;Batal&quot;
                FrmAwal()
        End Select
    End Sub
    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        OpenDlg.Title = &quot;Mencari File Data&quot;
        If (OpenDlg.ShowDialog() = DialogResult.OK) Then
            currFile = OpenDlg.FileName
            TPath.Text = currFile
            TextBox1.Enabled = True
            TextBox2.Enabled = True
            TextBox3.Enabled = True
        End If
    End Sub
    Private Sub Lv1_DoubleClick1(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV1.DoubleClick
        With Me.LV1
            LBKODE.Text = .SelectedItems(0).SubItems(0).Text
            ComboBox1.Text = .SelectedItems(0).SubItems(1).Text
            TextBox1.Text = .SelectedItems(0).SubItems(2).Text
            TextBox2.Text = .SelectedItems(0).SubItems(3).Text
            TextBox3.Text = .SelectedItems(0).SubItems(4).Text
        End With
        TampilPdf()
        Button4.Text = &quot;Batal&quot;
    End Sub
    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If Not ((e.KeyChar &gt;= &quot;0&quot; And e.KeyChar = &quot;0&quot; And e.KeyChar &lt;= &quot;9&quot;) Or e.KeyChar = vbBack) Then
            e.Handled() = True
        End If
    End Sub
    Sub TampilPdf()
        Dim fs As FileStream = Nothing

        Dim temp As String = &quot;D:\DataSiskumTemp\&quot; + LBKODE.Text

        Dim sql As String = &quot;SELECT * FROM Master WHERE Kode=&#039;&quot; &amp; LBKODE.Text &amp; &quot;&#039;&quot;
        Try
            adapter = New MySqlDataAdapter(sql, Conn)
            ds = New DataSet
            adapter.Fill(ds, &quot;Master&quot;)
            Dim myRow As DataRow

            myRow = ds.Tables(&quot;Master&quot;).Rows(0)

            Dim DataPDF() As Byte
            DataPDF = myRow(&quot;file&quot;)
            Dim Counter As Long

            Counter = UBound(DataPDF)
            fs = New FileStream(temp, FileMode.OpenOrCreate, FileAccess.Write)
            fs.Write(DataPDF, 0, Counter)
            fs.Close()
            adapter.Dispose()

        Catch ex As Exception
            MsgBox(&quot;Error : &quot; + ex.Message)
        Finally
            WebBrowser1.Refresh()
            WebBrowser1.Navigate(temp)
        End Try
    End Sub
    Private Sub TPath_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TPath.TextChanged
        If Not (TPath.Text = String.Empty) Then
            WebBrowser1.Navigate(TPath.Text)
        End If
    End Sub

End Class</description>
		<content:encoded><![CDATA[<p>ini script lengkapnya sudah saya lengkapi dan bisa jalan sempurna untuk menyimpan. MySql &amp; VB.NET 2010</p>
<p>Imports System.IO<br />
Imports MySql.Data.MySqlClient<br />
Imports System.Object<br />
Imports System.Windows.Forms<br />
Public Class Form1<br />
    Inherits System.Windows.Forms.Form<br />
    Private adapter As MySqlDataAdapter<br />
    Private currFile As String = Nothing<br />
    Dim table As DataTable<br />
    Dim mysqlCmd As MySqlCommand<br />
    Dim CommandText As MySqlCommand<br />
    Dim ds As DataSet<br />
    Dim fs As FileStream<br />
    Sub Tabel()<br />
        With LV1<br />
            .Columns.Add(&#8220;KODE&#8221;, 0, HorizontalAlignment.Center)<br />
            .Columns.Add(&#8220;KATEGORI&#8221;, 100, HorizontalAlignment.Center)<br />
            .Columns.Add(&#8220;NOMOR&#8221;, 75, HorizontalAlignment.Center)<br />
            .Columns.Add(&#8220;TAHUN&#8221;, 75, HorizontalAlignment.Center)<br />
            .Columns.Add(&#8220;TENTANG&#8221;, 500, HorizontalAlignment.Left)<br />
            .GridLines = True<br />
            .FullRowSelect = True<br />
            .View = View.Details<br />
        End With<br />
    End Sub<br />
    Sub TampilLV()<br />
        Dim DTLV As MySqlDataReader<br />
        Try<br />
            Conn.Open()<br />
            Dim CC As New MySqlCommand(&#8220;select * from MASTER  &#8220;, Conn)<br />
            DTLV = CC.ExecuteReader()<br />
            Dim i As Integer = 0<br />
            LV1.Items.Clear()<br />
            While DTLV.Read</p>
<p>                LV1.Items.Add(DTLV(&#8220;KOde&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Kategori&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Nomor&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tahun&#8221;))<br />
                LV1.Items(i).SubItems.Add(DTLV(&#8220;Tentang&#8221;))<br />
                i = i + 1<br />
            End While<br />
        Catch ex As Exception<br />
            MessageBox.Show(ex.Message)<br />
        Finally<br />
            Conn.Close() &#8216; must close after execute<br />
        End Try</p>
<p>    End Sub<br />
    Private Sub FrmKosong()<br />
        TextBox1.Text = &#8220;&#8221;<br />
        TextBox2.Text = &#8220;&#8221;<br />
        TextBox3.Text = &#8220;&#8221;<br />
        ComboBox1.Text = &#8220;&#8221;<br />
        WebBrowser1.Navigate(&#8220;&#8221;)<br />
    End Sub<br />
    Private Sub FrmMati()<br />
        TextBox1.Enabled = False<br />
        TextBox2.Enabled = False<br />
        TextBox3.Enabled = False<br />
        ComboBox1.Enabled = False<br />
    End Sub<br />
    Private Sub FrmHidup()<br />
        TextBox1.Enabled = True<br />
        TextBox2.Enabled = True<br />
        TextBox3.Enabled = True<br />
        ComboBox1.Enabled = True<br />
    End Sub<br />
    Private Sub FrmAwal()<br />
        FrmKosong()<br />
        FrmMati()<br />
        Button1.Text = &#8220;Baru&#8221;<br />
        Button2.Text = &#8220;Edit&#8221;<br />
        Button3.Text = &#8220;Hapus&#8221;<br />
        Button4.Text = &#8220;Tutup&#8221;<br />
        Button5.Text = &#8220;Open Pdf File&#8221;<br />
        Button1.Enabled = True<br />
        Button2.Enabled = True<br />
        Button3.Enabled = True<br />
        Button4.Enabled = True<br />
    End Sub<br />
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Tabel()<br />
        TampilLV()<br />
        Conn.Open()<br />
        Dim query As String = &#8220;SELECT * FROM KTGR&#8221;<br />
        Dim DA = New MySqlDataAdapter(query, Conn)<br />
        Dim DS = New DataSet<br />
        DA.Fill(DS, &#8220;KTGR&#8221;)<br />
        ComboBox1.Text = &#8220;&#8221;<br />
        With ComboBox1<br />
            .DataSource = DS.Tables(&#8220;KTGR&#8221;)<br />
            .DisplayMember = &#8220;Kategori&#8221;<br />
            .ValueMember = &#8220;Nomor&#8221;<br />
            .SelectedIndex = 0<br />
            .Text = &#8220;&#8221;<br />
        End With<br />
        Conn.Close()<br />
        FrmAwal()<br />
        TextBox2.MaxLength = 4<br />
        TextBox1.MaxLength = 4<br />
    End Sub<br />
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
        Dim ukuran As Integer<br />
        Dim fs As FileStream</p>
<p>        If Button1.Text = &#8220;Baru&#8221; Then<br />
            Button1.Text = &#8220;Simpan&#8221;<br />
            Button2.Enabled = False<br />
            Button3.Enabled = False<br />
            Button4.Text = &#8220;Batal&#8221;<br />
            FrmHidup()<br />
            TextBox1.Focus()<br />
            FrmKosong()<br />
        Else</p>
<p>            If ComboBox1.Text = &#8220;&#8221; Or TextBox1.Text = &#8220;&#8221; Or TextBox2.Text = &#8220;&#8221; Or TextBox3.Text = &#8220;&#8221; Then<br />
                MsgBox(&#8220;Data Belum Lengkap&#8230;!&#8221;, 48, &#8220;Error&#8221;)<br />
            Else</p>
<p>                Try<br />
                    fs = New FileStream(currFile, FileMode.Open, FileAccess.Read)<br />
                    ukuran = fs.Length<br />
                    Dim rawData() As Byte = New Byte(ukuran) {}<br />
                    fs.Read(rawData, 0, ukuran)<br />
                    fs.Close()</p>
<p>                    Dim sql As String = &#8220;SELECT * FROM MASTER&#8221;<br />
                    conn = New MySqlConnection(ConnectionString)<br />
                    conn.Open()</p>
<p>                    adapter = New MySqlDataAdapter(sql, Conn)<br />
                    Dim CmdBuilder As MySqlCommandBuilder = New MySqlCommandBuilder(adapter)<br />
                    Dim ds As DataSet = New DataSet(&#8220;MASTER&#8221;)<br />
                    adapter.Fill(ds, &#8220;MASTER&#8221;)<br />
                    Dim row As DataRow = ds.Tables(&#8220;MASTER&#8221;).NewRow()<br />
                    row(&#8220;Kode&#8221;) = ComboBox1.Text + TextBox1.Text<br />
                    row(&#8220;kategori&#8221;) = ComboBox1.Text<br />
                    row(&#8220;nomor&#8221;) = TextBox1.Text<br />
                    row(&#8220;tahun&#8221;) = TextBox2.Text<br />
                    row(&#8220;tentang&#8221;) = TextBox3.Text<br />
                    row(&#8220;na_file&#8221;) = Path.GetFileName(TPath.Text)<br />
                    row(&#8220;ukuran&#8221;) = ukuran<br />
                    row(&#8220;file&#8221;) = rawData<br />
                    ds.Tables(&#8220;MASTER&#8221;).Rows.Add(row)<br />
                    adapter.Update(ds, &#8220;MASTER&#8221;)<br />
                    MsgBox(&#8220;FIle Sudah Tersimpan&#8221;, MsgBoxStyle.Information, &#8220;OK&#8221;)<br />
                    conn.Close()<br />
                    FrmAwal()<br />
                    TampilLV()<br />
                Catch ex As Exception<br />
                    MsgBox(&#8220;Gagal Menyimpan Data Silahkan Mengulang&#8230;! &#8221; + ex.Message)<br />
                End Try<br />
            End If<br />
        End If<br />
    End Sub<br />
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
        If Button2.Text = &#8220;Edit&#8221; Then<br />
            Button2.Text = &#8220;Simpan&#8221;<br />
            Button1.Enabled = False<br />
            Button3.Enabled = False<br />
            Button4.Text = &#8220;Batal&#8221;<br />
            FrmHidup()<br />
            TextBox1.Focus()<br />
        Else<br />
            If TextBox1.Text = &#8220;&#8221; Or TextBox2.Text = &#8220;&#8221; Then<br />
                MsgBox(&#8220;Maaf Data Masih Kurang&#8221;, 48, &#8220;Error&#8221;)<br />
            Else<br />
                Conn.Open()<br />
                Dim SQLUbah As String<br />
                SQLUbah = &#8220;Update Master Set Kategori=&#8217;&#8221; &amp; ComboBox1.Text &amp; &#8220;&#8216;,Nomor=&#8217;&#8221; &amp; TextBox1.Text &amp; &#8220;&#8216;,Tahun=&#8217;&#8221; _<br />
                &amp; TextBox2.Text &amp; &#8220;&#8216;,Tentang=&#8217;&#8221; &amp; TextBox3.Text &amp; &#8220;&#8216;Where Kode=&#8217;&#8221; &amp; LBKODE.Text &amp; &#8220;&#8216;&#8221;<br />
                Cmd = New MySqlCommand(SQLUbah, Conn)<br />
                Cmd.ExecuteNonQuery()<br />
                MsgBox(&#8220;Data Telah Di Ubah&#8221;, MsgBoxStyle.OkOnly + MsgBoxStyle.Information, &#8220;Sukses&#8221;)<br />
                FrmAwal()<br />
                Conn.Close()<br />
                TampilLV()<br />
            End If<br />
        End If<br />
    End Sub<br />
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click<br />
        If TextBox1.Text = &#8220;&#8221; Then<br />
            MsgBox(&#8220;Maaf Tidak ada data yang akan dihapus&#8221;, 48, &#8220;Perhatian&#8221;)<br />
        Else<br />
            Dim Pesan As String<br />
            Pesan = MsgBox(&#8220;Yakin akan dihapus&#8221;, MsgBoxStyle.YesNo, &#8220;Konfirmasi&#8221;)<br />
            If Pesan = vbYes Then<br />
                Conn.Open()<br />
                Dim SQLHapus As String<br />
                SQLHapus = &#8220;Delete  From Master Where Kode=&#8217;&#8221; &amp; LBKODE.Text &amp; &#8220;&#8216;&#8221;<br />
                Cmd = New MySqlCommand(SQLHapus, Conn)<br />
                Cmd.ExecuteNonQuery()<br />
                Conn.Close()<br />
                FrmAwal()<br />
                TampilLV()<br />
            End If<br />
        End If<br />
    End Sub<br />
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click<br />
        Select Case Button4.Text<br />
            Case &#8220;Tutup&#8221;<br />
                Close()<br />
            Case &#8220;Batal&#8221;<br />
                FrmAwal()<br />
        End Select<br />
    End Sub<br />
    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click<br />
        OpenDlg.Title = &#8220;Mencari File Data&#8221;<br />
        If (OpenDlg.ShowDialog() = DialogResult.OK) Then<br />
            currFile = OpenDlg.FileName<br />
            TPath.Text = currFile<br />
            TextBox1.Enabled = True<br />
            TextBox2.Enabled = True<br />
            TextBox3.Enabled = True<br />
        End If<br />
    End Sub<br />
    Private Sub Lv1_DoubleClick1(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV1.DoubleClick<br />
        With Me.LV1<br />
            LBKODE.Text = .SelectedItems(0).SubItems(0).Text<br />
            ComboBox1.Text = .SelectedItems(0).SubItems(1).Text<br />
            TextBox1.Text = .SelectedItems(0).SubItems(2).Text<br />
            TextBox2.Text = .SelectedItems(0).SubItems(3).Text<br />
            TextBox3.Text = .SelectedItems(0).SubItems(4).Text<br />
        End With<br />
        TampilPdf()<br />
        Button4.Text = &#8220;Batal&#8221;<br />
    End Sub<br />
    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress<br />
        If Not ((e.KeyChar &gt;= &#8220;0&#8243; And e.KeyChar = &#8220;0&#8243; And e.KeyChar &lt;= &quot;9&quot;) Or e.KeyChar = vbBack) Then<br />
            e.Handled() = True<br />
        End If<br />
    End Sub<br />
    Sub TampilPdf()<br />
        Dim fs As FileStream = Nothing</p>
<p>        Dim temp As String = &quot;D:\DataSiskumTemp\&quot; + LBKODE.Text</p>
<p>        Dim sql As String = &quot;SELECT * FROM Master WHERE Kode=&#039;&quot; &amp; LBKODE.Text &amp; &quot;&#039;&quot;<br />
        Try<br />
            adapter = New MySqlDataAdapter(sql, Conn)<br />
            ds = New DataSet<br />
            adapter.Fill(ds, &quot;Master&quot;)<br />
            Dim myRow As DataRow</p>
<p>            myRow = ds.Tables(&quot;Master&quot;).Rows(0)</p>
<p>            Dim DataPDF() As Byte<br />
            DataPDF = myRow(&quot;file&quot;)<br />
            Dim Counter As Long</p>
<p>            Counter = UBound(DataPDF)<br />
            fs = New FileStream(temp, FileMode.OpenOrCreate, FileAccess.Write)<br />
            fs.Write(DataPDF, 0, Counter)<br />
            fs.Close()<br />
            adapter.Dispose()</p>
<p>        Catch ex As Exception<br />
            MsgBox(&quot;Error : &quot; + ex.Message)<br />
        Finally<br />
            WebBrowser1.Refresh()<br />
            WebBrowser1.Navigate(temp)<br />
        End Try<br />
    End Sub<br />
    Private Sub TPath_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TPath.TextChanged<br />
        If Not (TPath.Text = String.Empty) Then<br />
            WebBrowser1.Navigate(TPath.Text)<br />
        End If<br />
    End Sub</p>
<p>End Class</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by djie</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-219</link>
		<dc:creator>djie</dc:creator>
		<pubDate>Mon, 09 Apr 2012 03:57:28 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-219</guid>
		<description>mantap.... contoh program kayak gini yang aku cari.. thk</description>
		<content:encoded><![CDATA[<p>mantap&#8230;. contoh program kayak gini yang aku cari.. thk</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by katirefa</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-218</link>
		<dc:creator>katirefa</dc:creator>
		<pubDate>Sun, 01 Apr 2012 05:23:14 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-218</guid>
		<description>Ini script yg saya buat hanya untuk menyimpan file PDF ke database MySQL dan sepertinya berfungsi baik, tapi mungkin Mas Anto atau sipa saja bisa mengkoreksinya.

Imports System.IO
Imports MySql.Data.MySqlClient

Public Class F_Simpan
    Inherits System.Windows.Forms.Form
    Private conn As MySqlConnection
    Private adapter As MySqlDataAdapter
    Private currFile As String = Nothing

    Private Sub bt_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_keluar.Click
        End
    End Sub

    Private Sub bt_buka_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_buka.Click
        OpenDlg.Title = &quot;Mencari File Data&quot;
        If (OpenDlg.ShowDialog() = DialogResult.OK) Then
            currFile = OpenDlg.FileName
            txt_file.Text = currFile
        End If
    End Sub

    Private Sub txt_file_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_file.TextChanged
        If Not (txt_file.Text = String.Empty) Then
            Dim PDF = AxAcroPDF1.LoadFile(txt_file.Text)
            AxAcroPDF1.OcxState = AxAcroPDF1.OcxState
        End If
    End Sub

    Private Sub bt_simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_simpan.Click
        Dim ukuran As Integer
        Dim fs As FileStream
        Dim connStr As String
        connStr = &quot;server=localhost;uid=root;database=datablob;&quot;
        Try
            fs = New FileStream(currFile, FileMode.Open, FileAccess.Read)

            ukuran = fs.Length
            Dim rawData() As Byte = New Byte(ukuran) {}
            fs.Read(rawData, 0, ukuran)
            fs.Close()

            Dim sql As String = &quot;SELECT * FROM data_blob&quot;
            conn = New MySqlConnection(connStr)
            conn.Open()

            adapter = New MySqlDataAdapter(sql, conn)
            Dim CmdBuilder As MySqlCommandBuilder = New MySqlCommandBuilder(adapter)
            Dim ds As DataSet = New DataSet(&quot;data_blob&quot;)

            adapter.Fill(ds, &quot;data_blob&quot;)

            Dim row As DataRow = ds.Tables(&quot;data_blob&quot;).NewRow()
            row(&quot;kode_file&quot;) = txt_kode.Text
            row(&quot;deskripsi&quot;) = txt_des.Text

            row(&quot;nama_file&quot;) = Path.GetFileName(txt_file.Text)
            row(&quot;ukuran&quot;) = ukuran
            row(&quot;file&quot;) = rawData

            ds.Tables(&quot;data_blob&quot;).Rows.Add(row)

            adapter.Update(ds, &quot;data_blob&quot;)
            MsgBox(&quot;Data berhasil disimpan&quot;, MsgBoxStyle.Information, &quot;Insert OK&quot;)
            conn.Close()

            txt_kode.Text = &quot;&quot; : txt_des.Text = &quot;&quot;
            txt_file.Text = &quot;&quot; : txt_kode.Focus()
            &#039;pic.Image = Nothing
            AxAcroPDF1.Refresh()
        Catch ex As Exception
            MsgBox(&quot;Failed to Insert:&quot; + ex.Message)
        End Try
    End Sub
End Class

Tapi untuk menampilkannya selalu gagal pesan yang muncul &quot;Out of Memmory&quot;

ini script untuk menampilkannya ke Form

Imports MySql.Data.MySqlClient
Imports System.IO

Public Class Tampil
    Inherits System.Windows.Forms.Form

    Private conn As MySqlConnection
    Private adapter As MySqlDataAdapter
    Private ds As DataSet

    Private Sub Tampil_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim sql As String = &quot;SELECT * FROM data_blob&quot;
        Dim ConnStr As String = &quot;server=localhost;uid=root;database=datablob;&quot;
        Try
            conn = New MySqlConnection(ConnStr)
            conn.Open()
            ds = New DataSet
            adapter = New MySqlDataAdapter(sql, conn)
            adapter.Fill(ds, &quot;data_blop&quot;)
            BindListControls()

        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Information, &quot;Error&quot;)
        End Try
    End Sub

    Private Sub BindListControls()
        cbxkode.DataSource = ds.Tables(0)
        cbxkode.DisplayMember = &quot;kode_file&quot;
        cbxdes.DataSource = ds.Tables(0)
        cbxdes.DisplayMember = &quot;deskripsi&quot;
        cbxnama.DataSource = ds.Tables(0)
        cbxnama.DisplayMember = &quot;nama_file&quot;
        cbxsize.DataSource = ds.Tables(0)
        cbxsize.DisplayMember = &quot;ukuran&quot;
    End Sub

    Private Sub btn_lihat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_lihat.Click
        Dim OpenFile As Image = Nothing
        Dim fs As FileStream = Nothing

        &#039;Deklarasi variabel untuk temporary file
        Dim temp As String = &quot;D:\\&quot; + cbxnama.Text

        &#039;SQL dengan kondisi kode_file
        Dim sql As String = &quot;SELECT * FROM data_blob WHERE kode_file=&#039;&quot; &amp; cbxkode.Text &amp; &quot;&#039;&quot;
        Try
            adapter = New MySqlDataAdapter(sql, conn)
            ds = New DataSet
            adapter.Fill(ds, &quot;data_blob&quot;)
            Dim myRow As DataRow

            &#039;Menetapkan Index data
            myRow = ds.Tables(&quot;data_blob&quot;).Rows(0)

            Dim DataFL() As Byte
            DataFL = myRow(&quot;file&quot;)
            Dim Counter As Long

            &#039;Mendapatkan jumlah total Elemen array
            Counter = UBound(DataFL)
            fs = New FileStream(temp, FileMode.OpenOrCreate, FileAccess.Write)
            fs.Write(DataFL, 0, Counter)
            fs.Close()
            adapter.Dispose()

        Catch ex As Exception
            MsgBox(&quot;Error : &quot; + ex.Message)
        Finally
            &#039;Menampilkan File
            PDF_Tampil.OcxState = Nothing
            OpenFile = Image.FromFile(temp)
            PDF_Tampil.OcxState = PDF_Tampil.OcxState
        End Try
    End Sub

    Private Sub bt_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_keluar.Click
        End
    End Sub

End Class</description>
		<content:encoded><![CDATA[<p>Ini script yg saya buat hanya untuk menyimpan file PDF ke database MySQL dan sepertinya berfungsi baik, tapi mungkin Mas Anto atau sipa saja bisa mengkoreksinya.</p>
<p>Imports System.IO<br />
Imports MySql.Data.MySqlClient</p>
<p>Public Class F_Simpan<br />
    Inherits System.Windows.Forms.Form<br />
    Private conn As MySqlConnection<br />
    Private adapter As MySqlDataAdapter<br />
    Private currFile As String = Nothing</p>
<p>    Private Sub bt_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_keluar.Click<br />
        End<br />
    End Sub</p>
<p>    Private Sub bt_buka_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_buka.Click<br />
        OpenDlg.Title = &#8220;Mencari File Data&#8221;<br />
        If (OpenDlg.ShowDialog() = DialogResult.OK) Then<br />
            currFile = OpenDlg.FileName<br />
            txt_file.Text = currFile<br />
        End If<br />
    End Sub</p>
<p>    Private Sub txt_file_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_file.TextChanged<br />
        If Not (txt_file.Text = String.Empty) Then<br />
            Dim PDF = AxAcroPDF1.LoadFile(txt_file.Text)<br />
            AxAcroPDF1.OcxState = AxAcroPDF1.OcxState<br />
        End If<br />
    End Sub</p>
<p>    Private Sub bt_simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_simpan.Click<br />
        Dim ukuran As Integer<br />
        Dim fs As FileStream<br />
        Dim connStr As String<br />
        connStr = &#8220;server=localhost;uid=root;database=datablob;&#8221;<br />
        Try<br />
            fs = New FileStream(currFile, FileMode.Open, FileAccess.Read)</p>
<p>            ukuran = fs.Length<br />
            Dim rawData() As Byte = New Byte(ukuran) {}<br />
            fs.Read(rawData, 0, ukuran)<br />
            fs.Close()</p>
<p>            Dim sql As String = &#8220;SELECT * FROM data_blob&#8221;<br />
            conn = New MySqlConnection(connStr)<br />
            conn.Open()</p>
<p>            adapter = New MySqlDataAdapter(sql, conn)<br />
            Dim CmdBuilder As MySqlCommandBuilder = New MySqlCommandBuilder(adapter)<br />
            Dim ds As DataSet = New DataSet(&#8220;data_blob&#8221;)</p>
<p>            adapter.Fill(ds, &#8220;data_blob&#8221;)</p>
<p>            Dim row As DataRow = ds.Tables(&#8220;data_blob&#8221;).NewRow()<br />
            row(&#8220;kode_file&#8221;) = txt_kode.Text<br />
            row(&#8220;deskripsi&#8221;) = txt_des.Text</p>
<p>            row(&#8220;nama_file&#8221;) = Path.GetFileName(txt_file.Text)<br />
            row(&#8220;ukuran&#8221;) = ukuran<br />
            row(&#8220;file&#8221;) = rawData</p>
<p>            ds.Tables(&#8220;data_blob&#8221;).Rows.Add(row)</p>
<p>            adapter.Update(ds, &#8220;data_blob&#8221;)<br />
            MsgBox(&#8220;Data berhasil disimpan&#8221;, MsgBoxStyle.Information, &#8220;Insert OK&#8221;)<br />
            conn.Close()</p>
<p>            txt_kode.Text = &#8220;&#8221; : txt_des.Text = &#8220;&#8221;<br />
            txt_file.Text = &#8220;&#8221; : txt_kode.Focus()<br />
            &#8216;pic.Image = Nothing<br />
            AxAcroPDF1.Refresh()<br />
        Catch ex As Exception<br />
            MsgBox(&#8220;Failed to Insert:&#8221; + ex.Message)<br />
        End Try<br />
    End Sub<br />
End Class</p>
<p>Tapi untuk menampilkannya selalu gagal pesan yang muncul &#8220;Out of Memmory&#8221;</p>
<p>ini script untuk menampilkannya ke Form</p>
<p>Imports MySql.Data.MySqlClient<br />
Imports System.IO</p>
<p>Public Class Tampil<br />
    Inherits System.Windows.Forms.Form</p>
<p>    Private conn As MySqlConnection<br />
    Private adapter As MySqlDataAdapter<br />
    Private ds As DataSet</p>
<p>    Private Sub Tampil_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
        Dim sql As String = &#8220;SELECT * FROM data_blob&#8221;<br />
        Dim ConnStr As String = &#8220;server=localhost;uid=root;database=datablob;&#8221;<br />
        Try<br />
            conn = New MySqlConnection(ConnStr)<br />
            conn.Open()<br />
            ds = New DataSet<br />
            adapter = New MySqlDataAdapter(sql, conn)<br />
            adapter.Fill(ds, &#8220;data_blop&#8221;)<br />
            BindListControls()</p>
<p>        Catch ex As Exception<br />
            MsgBox(ex.Message, MsgBoxStyle.Information, &#8220;Error&#8221;)<br />
        End Try<br />
    End Sub</p>
<p>    Private Sub BindListControls()<br />
        cbxkode.DataSource = ds.Tables(0)<br />
        cbxkode.DisplayMember = &#8220;kode_file&#8221;<br />
        cbxdes.DataSource = ds.Tables(0)<br />
        cbxdes.DisplayMember = &#8220;deskripsi&#8221;<br />
        cbxnama.DataSource = ds.Tables(0)<br />
        cbxnama.DisplayMember = &#8220;nama_file&#8221;<br />
        cbxsize.DataSource = ds.Tables(0)<br />
        cbxsize.DisplayMember = &#8220;ukuran&#8221;<br />
    End Sub</p>
<p>    Private Sub btn_lihat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_lihat.Click<br />
        Dim OpenFile As Image = Nothing<br />
        Dim fs As FileStream = Nothing</p>
<p>        &#8216;Deklarasi variabel untuk temporary file<br />
        Dim temp As String = &#8220;D:\\&#8221; + cbxnama.Text</p>
<p>        &#8216;SQL dengan kondisi kode_file<br />
        Dim sql As String = &#8220;SELECT * FROM data_blob WHERE kode_file=&#8217;&#8221; &amp; cbxkode.Text &amp; &#8220;&#8216;&#8221;<br />
        Try<br />
            adapter = New MySqlDataAdapter(sql, conn)<br />
            ds = New DataSet<br />
            adapter.Fill(ds, &#8220;data_blob&#8221;)<br />
            Dim myRow As DataRow</p>
<p>            &#8216;Menetapkan Index data<br />
            myRow = ds.Tables(&#8220;data_blob&#8221;).Rows(0)</p>
<p>            Dim DataFL() As Byte<br />
            DataFL = myRow(&#8220;file&#8221;)<br />
            Dim Counter As Long</p>
<p>            &#8216;Mendapatkan jumlah total Elemen array<br />
            Counter = UBound(DataFL)<br />
            fs = New FileStream(temp, FileMode.OpenOrCreate, FileAccess.Write)<br />
            fs.Write(DataFL, 0, Counter)<br />
            fs.Close()<br />
            adapter.Dispose()</p>
<p>        Catch ex As Exception<br />
            MsgBox(&#8220;Error : &#8221; + ex.Message)<br />
        Finally<br />
            &#8216;Menampilkan File<br />
            PDF_Tampil.OcxState = Nothing<br />
            OpenFile = Image.FromFile(temp)<br />
            PDF_Tampil.OcxState = PDF_Tampil.OcxState<br />
        End Try<br />
    End Sub</p>
<p>    Private Sub bt_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_keluar.Click<br />
        End<br />
    End Sub</p>
<p>End Class</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by katirefa</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-217</link>
		<dc:creator>katirefa</dc:creator>
		<pubDate>Sun, 01 Apr 2012 05:15:03 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-217</guid>
		<description>Salam kenal... 
Kalau untuk menyimpan file gambar ke Database dan menampilkannya kembali mungkin sudah banyak yang membahasnya, tapi kalau diganti dengan menyimpan file yang berupa PDF ke database dan menamplkannya kembali saya belum pernah ketemu, Nah... sekarang bisa nggak Mas Anto Aplikasi diatas diubah kebetulan saya punya kasus demikian dan sampai sekarang belum bisa saya pecahkan terutama untuk menampilkannya kembali pada form dengan VB.net dan MySql. mungkin sekiranya Mas Anto bisa bantu saya dan mungkin juga berguna bagi rekan2 yg ada disini.... Trims...</description>
		<content:encoded><![CDATA[<p>Salam kenal&#8230;<br />
Kalau untuk menyimpan file gambar ke Database dan menampilkannya kembali mungkin sudah banyak yang membahasnya, tapi kalau diganti dengan menyimpan file yang berupa PDF ke database dan menamplkannya kembali saya belum pernah ketemu, Nah&#8230; sekarang bisa nggak Mas Anto Aplikasi diatas diubah kebetulan saya punya kasus demikian dan sampai sekarang belum bisa saya pecahkan terutama untuk menampilkannya kembali pada form dengan VB.net dan MySql. mungkin sekiranya Mas Anto bisa bantu saya dan mungkin juga berguna bagi rekan2 yg ada disini&#8230;. Trims&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mengganti Admin Template Joomla by Mas Anto</title>
		<link>http://mas-anto.com/mengganti-admin-template-joomla/comment-page-1#comment-205</link>
		<dc:creator>Mas Anto</dc:creator>
		<pubDate>Sun, 04 Mar 2012 16:25:32 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/antodotcom/?p=78#comment-205</guid>
		<description>coba pilih antara Wordpress dengan plugin Wordpress Ecommerce atau menggunakan Joomla+Virtuemart-nya.

Wordpress sederhana dan simple serta gak butuh resource besar
Joomla bisa bikin web yang lebih variatif+dinamis cuma butuh resource lebih besar</description>
		<content:encoded><![CDATA[<p>coba pilih antara WordPress dengan plugin WordPress Ecommerce atau menggunakan Joomla+Virtuemart-nya.</p>
<p>WordPress sederhana dan simple serta gak butuh resource besar<br />
Joomla bisa bikin web yang lebih variatif+dinamis cuma butuh resource lebih besar</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Mengganti Admin Template Joomla by Thomas</title>
		<link>http://mas-anto.com/mengganti-admin-template-joomla/comment-page-1#comment-199</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Wed, 29 Feb 2012 01:24:37 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/antodotcom/?p=78#comment-199</guid>
		<description>Mas Anto,

Saya mau nanya nih.Gimana ya caranya membangun website dinamis dengan front end dan backend yang saling berhubungan? Saya tertarik untuk membangun website online commerce yang interactive.

Thanks atas inputnya</description>
		<content:encoded><![CDATA[<p>Mas Anto,</p>
<p>Saya mau nanya nih.Gimana ya caranya membangun website dinamis dengan front end dan backend yang saling berhubungan? Saya tertarik untuk membangun website online commerce yang interactive.</p>
<p>Thanks atas inputnya</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Membuat Program Kontak Berfoto dengan VB.NET dan SQLServer by jhonry</title>
		<link>http://mas-anto.com/membuat-program-kontak-berfoto-dengan-vbnet-dan-sqlserver/comment-page-1#comment-197</link>
		<dc:creator>jhonry</dc:creator>
		<pubDate>Mon, 20 Feb 2012 10:08:56 +0000</pubDate>
		<guid isPermaLink="false">http://mas-anto.com/?p=370#comment-197</guid>
		<description>Thanks mas buat share ilmunya..lagi belajar vb.net ni.,,.topiknya sama lagi.,mantap.,.,,</description>
		<content:encoded><![CDATA[<p>Thanks mas buat share ilmunya..lagi belajar vb.net ni.,,.topiknya sama lagi.,mantap.,.,,</p>
]]></content:encoded>
	</item>
</channel>
</rss>

