Forum

Visual Studio 2015 ...
 
Bildirimler
Hepsini Temizle

Visual Studio 2015 - Visual Basic SQL güncelleme

2 Yazılar
2 Üyeler
0 Likes
533 Görüntüleme
(@MuratSulupinar)
Gönderiler: 1
New Member
Konu başlatıcı
 

Visual Basic de yaptığım bir projede, güncelleme yaptıgımda bütün tabloyu güncelliyor. (SQL Veritabanı)

 

böyle bir güncelleme butonu var;

 

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If TextBox1.Text = "" Then
MsgBox("Lütfen barkod veya kod giriniz", vbInformation)

Else
barkod = TextBox1.Text
urunad = TextBox2.Text
fiyat = TextBox3.Text
kdvoran = TextBox4.Text
is1 = TextBox5.Text
is2 = TextBox6.Text
is3 = TextBox7.Text
kdvtut = TextBox8.Text
acik = TextBox9.Text
kmarj = TextBox10.Text

komut.Connection = baglantı
komut.CommandText = "update urun set barkod ='" & TextBox1.Text & "', urunad ='" & TextBox2.Text & "',fiyat ='" & TextBox3.Text & "',kdvoran ='" & TextBox4.Text & "',is1 ='" & TextBox5.Text & "',is2 ='" & TextBox6.Text & "',is3 ='" & TextBox7.Text & "',kdvtut ='" & TextBox8.Text & "',acik ='" & TextBox9.Text & "',kmarj ='" & TextBox10.Text & "'"

baglantı.Open()
komut.ExecuteNonQuery()
baglantı.Close()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = "00"
TextBox4.Text = "00"
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
MsgBox("Ürün Kaydı Güncellendi.", vbInformation)
Button1.Enabled = True

End If
End Sub

 

 

 
Gönderildi : 27/08/2016 18:22

(@birolaydugan)
Gönderiler: 867
Prominent Member
 

Where ile filtreleme yapabilirsiniz .

 
Gönderildi : 27/08/2016 21:51

Paylaş: