Şimdi Ara

VB.NET Veritabanı Update Etme

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
5
Cevap
0
Favori
4.706
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Arkadaşlar bir sorunum var benim amacım veritabına kayıtlı olan veriyi vb' de güncellemek ancak bazı sorunlarım var internette biraz araştırdım ama anlayacağım bilgilere ulaşamadım.

    Kodlar;
    Dim baglanti As New OleDbConnection
    Dim komut As New OleDbCommand
    Dim adp As New OleDbDataAdapter
    Dim ds As New DataSet

    baglanti.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0; Data Source=C:\Ogrenci\Ogrenci.mdb"
    baglanti.Open()

    komut.CommandType = CommandType.Text
    If CheckBox1.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_adi='" & TextBox1.Text & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox2.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_soyadi='" & TextBox2.Text & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox4.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_cinsiyeti='" & CheckBox5.Checked & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox1.Checked = True And CheckBox2.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_adi='" & TextBox1.Text & "', ogrenci_soyadi='" & TextBox2.Text & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox1.Checked = True And CheckBox4.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_adi='" & TextBox1.Text & "', ogrenci_cinsiyeti='" & CheckBox5.Checked & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox2.Checked = True And CheckBox4.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_soyadi='" & TextBox2.Text & "', ogrenci_cinsiyeti='" & CheckBox5.Checked & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    End If

    komut.Connection = baglanti


    kodlar bu şekilde bir eksikliğinin olduğunu ben de biliyorum ama bilgim kıt olduğu için yapamıyorum sanırsam sql cümleciklerinde sorun yok ama ondan sonra kullanacağım kodları bilmiyorum, form ekranının resmini de ekledim.

    Yardımcı olan herkese şimdiden teşekkür ederim.

     VB.NET Veritabanı Update Etme







  • up
  • arkadaşım sorunu çözdüysen eğer prg linkibni upload edebilirmisin pm atarsan çok şii olur kardeşim neyse ii akşamlar
  • quote:

    Orjinalden alıntı: okanbozkurts

    Arkadaşlar bir sorunum var benim amacım veritabına kayıtlı olan veriyi vb' de güncellemek ancak bazı sorunlarım var internette biraz araştırdım ama anlayacağım bilgilere ulaşamadım.

    Kodlar;
    Dim baglanti As New OleDbConnection
    Dim komut As New OleDbCommand
    Dim adp As New OleDbDataAdapter
    Dim ds As New DataSet

    baglanti.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0; Data Source=C:\Ogrenci\Ogrenci.mdb"
    baglanti.Open()

    komut.CommandType = CommandType.Text
    If CheckBox1.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_adi='" & TextBox1.Text & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox2.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_soyadi='" & TextBox2.Text & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox4.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_cinsiyeti='" & CheckBox5.Checked & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox1.Checked = True And CheckBox2.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_adi='" & TextBox1.Text & "', ogrenci_soyadi='" & TextBox2.Text & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox1.Checked = True And CheckBox4.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_adi='" & TextBox1.Text & "', ogrenci_cinsiyeti='" & CheckBox5.Checked & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    ElseIf CheckBox2.Checked = True And CheckBox4.Checked = True Then
    komut.CommandText = "Update Ogrenci Set ogrenci_soyadi='" & TextBox2.Text & "', ogrenci_cinsiyeti='" & CheckBox5.Checked & "' Where ogrenci_no='" & Val(TextBox3.Text) & "'"
    End If

    komut.Connection = baglanti


    kodlar bu şekilde bir eksikliğinin olduğunu ben de biliyorum ama bilgim kıt olduğu için yapamıyorum sanırsam sql cümleciklerinde sorun yok ama ondan sonra kullanacağım kodları bilmiyorum, form ekranının resmini de ekledim.

    Yardımcı olan herkese şimdiden teşekkür ederim.

     VB.NET Veritabanı Update Etme




    UZun zamandan beri SQL Kodları ile uğraşmıyordum eğer kodlarımı bulursam sana yollarım ve bana eğer bu program ve kodlarını upload edip yollarsan sorunu çözebilirsem sana geri yollarım

    yada update' i boş ver programı doğruca tekrar yaz lazım olan yere yolla bu kadar uğraştığına değmez



    < Bu mesaj bu kişi tarafından değiştirildi Proob -- 22 Mart 2009; 18:33:25 >




  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.