Yaz Yazabilirsen  

Geri Git   Yaz Yazabilirsen > Bilgisayar > Programlama Dilleri > Diğerleri ( C, C++ , visual basic, java ... )

Yeni Konu Gönder Yanıtla
 
Konu Araçları Mod Seç
Eski 08-08-2008, 10:27 AM   #1
mervesar
Kıdemli Üye
 
mervesar kullanıcısının avatarı
 
Giriş Tarihi: Aug 2008
Mesajlar: 497
mervesar is on a distinguished road
Lightbulb Visual Basic . net 2005 (Database)



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


mervesar şu an çevrimdışı   Alıntı Yaparak Cevapla
Eski 10-24-2008, 08:05 PM   #2
ortakatro
Kıdemli Üye
 
ortakatro kullanıcısının avatarı
 
Giriş Tarihi: Jul 2008
Mesajlar: 757
ortakatro is on a distinguished road
Varsayılan Re: Visual Basic . net 2005 (Database)

paylaşım için teşekkürler
__________________
KENDİNE GÜVENEN ŞÖYLE GELSİN....
ortakatro şu an çevrimdışı   Alıntı Yaparak Cevapla
Yanıtla

Bookmarks


Şu an bu konuyu görüntüleyen kullanıcı sayısı: 1 (0 üye ve 1 misafir)
 
Konu Araçları
Mod Seç

Gönderme Kuralları
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Açık
SimgelerAçık
[IMG] kodu Açık
HTML kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Kapalı
Refbacks are Kapalı
Hızlı Geçiş

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


Saat 03:21 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0