|
|
|
#1 |
|
Kıdemli Üye
Giriş Tarihi: Aug 2008
Mesajlar: 497
![]() |
Public Class Form2
Dim Baglanti As OleDb.OleDbConnection Dim Komut As OleDb.OleDbCommand Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Baglanti = New OleDb.OleDbConnection("Provider=Microsoft.Jet.oled b.4.0;Data Source=" & Application.StartupPath & "\vt2.mdb;") VeriGoster() End Sub Sub VeriGoster() Dim Adap As OleDb.OleDbDataAdapter Adap = New OleDb.OleDbDataAdapter("select * from tablo", Baglanti) Dim Ds As New DataSet Adap.Fill(Ds, "tablo") DataGridView1.DataSource = Ds.Tables("tablo") Baglanti.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Komut = New OleDb.OleDbCommand("insert into tablo(ad,soyad,numara) values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "')", Baglanti) Komut.Connection.Open() 'yapılan islemin veritabanına aktarılmasını saglar Komut.ExecuteNonQuery() Baglanti.Close() VeriGoster() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Komut = New OleDb.OleDbCommand("update tablo set ad='" + TextBox7.Text + "', soyad='" + TextBox8.Text + "', numara='" + TextBox9.Text + "' where ad='" + TextBox4.Text + "' and soyad='" + TextBox5.Text + "' and numara='" + TextBox6.Text + "'", Baglanti) Komut.Connection.Open() Komut.ExecuteNonQuery() Baglanti.Close() VeriGoster() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim Hangisi As String If RadioButton1.Checked = True Then Hangisi = "ad" ElseIf RadioButton2.Checked = True Then Hangisi = "soyad" ElseIf RadioButton3.Checked = True Then Hangisi = "numara" Else Exit Sub End If MsgBox("delete from tablo where " + Hangisi + "='" + TextBox10.Text + "'") Komut = New OleDb.OleDbCommand("delete from tablo where " + Hangisi + "='" + TextBox10.Text + "'", Baglanti) Komut.Connection.Open() Komut.ExecuteNonQuery() Baglanti.Close() VeriGoster() End Sub Private Sub DataGridView1_RowEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowEnter TextBox4.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value TextBox5.Text = DataGridView1.Rows(e.RowIndex).Cells(2).Value TextBox6.Text = DataGridView1.Rows(e.RowIndex).Cells(3).Value End Sub End Class
__________________
---------------------------- °¸'΅Θק Мз®ώξѕǻ® קΘ΅'¸° ---------------------------- ''Kendin için yaşamalısın her şeyden önce bu dünyada..Yoksa bu dünya senin olmaktan çıkar..Başkalarının dünyasında bir figüran olursun sadece..'' ----------------------------------------------------------------- xox |
|
|
|
|
|
#2 |
|
Kıdemli Üye
Giriş Tarihi: Jul 2008
Mesajlar: 757
![]() |
paylaşım için teşekkürler
__________________
KENDİNE GÜVENEN ŞÖYLE GELSİN.... |
|
|
|
![]() |
| Bookmarks |
| Şu an bu konuyu görüntüleyen kullanıcı sayısı: 1 (0 üye ve 1 misafir) | |
| Konu Araçları | |
| Mod Seç | |
|
|
Benzer Konular
|
||||
| Konu | Konuyu Başlatan | Forum | Yanıtlar | Son Mesaj |
| Visual Basic 6.0 - Kayıt İşlemleri | mervesar | Diğerleri ( C, C++ , visual basic, java ... ) | 2 | 11-02-2008 03:04 PM |
| Visual Basic - Karakter Fonksiyonları | mervesar | Diğerleri ( C, C++ , visual basic, java ... ) | 1 | 10-24-2008 08:09 PM |