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.
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.
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 >
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.
< Resime gitmek için tıklayın >