2010 İle düzenlemiştim Genede Teşekkürler.
Kodlarını da paylaşabilirim
FORM1
---------------------------------------------------------------------------
Imports System.Data.OleDb
Public Class Form1
Private baglanti As New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=Veritabani.mdb")
Private komut As New OleDbCommand()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
baglanti.Open()
komut.Connection = baglanti
komut.CommandText = "INSERT INTO statu(statu_tur) VALUES ('" + TextBox1.Text & "') "
komut.ExecuteNonQuery()
komut.Dispose()
MsgBox("Statü kaydedildi")
baglanti.Close()
End Sub
Private Sub FormClosing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Form2.listelec()
End Sub
End Class
FORM2
---------------------------------------------------------------------------
Imports System.Data
Imports System.Data.OleDb
Public Class Form2
Private baglanti As New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=Veritabani.mdb")
Private Sub listele()
baglanti.Open()
Dim
Sql As String
Sql = "select statu_tur from statu group by statu_tur"
Dim komut As New System.Data.OleDb.OleDbCommand(sql, baglanti)
Dim veri_okuyucu As Data.OleDb.OleDbDataReader
veri_okuyucu = komut.ExecuteReader
ComboBox1.Text = ""
ComboBox1.Items.Clear()
While (veri_okuyucu.Read())
ComboBox1.Items.Add(veri_okuyucu("statu_tur"))
End While
baglanti.Close()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
listele()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form1.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
listelec()
End Sub
End Class