Otel Takip programı yazıyorum . donem odevi olarak. sql bağlantıları tamam da veri kaydetme vb. konlarda hatalarım oldu tahmini hataları işaretledim fakat cozmuş değilim yardımlarınızı bekliorm şimdiden teşekkurler..
HERKESE İYİ CALIŞMALAR
Kod:
PrivateSub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click Try con.Open() Dim komut AsNew OleDb.OleDbCommand("update musbil set [Oda No][email protected], [email protected], [email protected], [Tc Kimlik veya Pas no][email protected], [Oda turu][email protected], [Kişi Sayısı][email protected] where [Oda No][email protected] ", con) '---------------------------------------------------------------------- 'oda no olmıyınca ad ile olan kısım boyle brakıyorum '---------------------------------------------------------------------- '---------------------------------------------------------------------- komut.Parameters.Add("@ad", OleDb.OleDbType.VarChar).Value = TextBox8.Text '---------------------------------------------------------------------- komut.Parameters.Add("@soyad", OleDb.OleDbType.VarChar).Value = TextBox7.Text komut.Parameters.Add("@tcno", OleDb.OleDbType.VarChar).Value = TextBox6.Text komut.Parameters.Add("@otur", OleDb.OleDbType.VarChar).Value = ComboBox1.SelectedItem komut.Parameters.Add("@ksay", OleDb.OleDbType.VarChar).Value = ComboBox2.SelectedItem '---------------------------------------------------------------------- 'oda no guncellenebilir değildir hatası komut.Parameters.Add("@ono", OleDb.OleDbType.Integer).Value = DataGridView1.CurrentRow.Cells(0).Value ' oda no yu tamamen kaldırıp ada gore yapınca ise muşteri adı guncelenebilir olmuyor hata vermiyor fakat guncellenmiyor da '---------------------------------------------------------------------- komut.ExecuteNonQuery() con.Close() Yenile() Catch ex AsException MsgBox("Guncellemede Hata Oluştu Ayrıntı: " & ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "Uyarı") EndTry Panel2.Visible = False EndSub PrivateSub Panel2_Leave(ByVal sender AsObject, ByVal e As System.EventArgs) Handles Panel2.Leave If Panel2.Visible = TrueThen MsgBox("Lutfen Guncellemeyi Bitiriniz.", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Uyarı") Panel2.Focus() EndIf EndSub PrivateFunction Nullable() AsObject ThrowNewNotImplementedException EndFunction PrivateSub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim a AsDouble con.Open() Dim komut AsNew OleDb.OleDbCommand("select * from musbil where [Oda No][email protected]", con) komut.Parameters.Add("@ono", OleDb.OleDbType.Integer).Value = DataGridView1.CurrentRow.Cells(0).Value Dim satir As OleDb.OleDbDataReader = komut.ExecuteReader While satir.Read a = satir("ucret").ToString EndWhile If MsgBox("Kişinin Şu Anki Harcama Tutarı = " & a & vbCrLf & " Ekleme Yapmak İstediğinizden Eminmisiniz?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "Bilgilendirme") = MsgBoxResult.Yes Then Dim komut2 AsNew OleDb.OleDbCommand("update musbil set [Oda No][email protected], [ucret][email protected] where [Oda No][email protected] ", con) '----------------------------------------------------------------------- ' ekleme başarılı Gozukmesine Karşın tutar 0 olarak kalıyor komut2.Parameters.Add("@ucret", OleDb.OleDbType.VarChar).Value = a + InputBox("Eklenecek Tutar", "Ucret Ekleme") '---------------------------------------------------------------------- Yenile() Dim b AsDouble Dim komut3 AsNew OleDb.OleDbCommand("select * from musbil where [Oda No][email protected]", con) komut3.Parameters.Add("@ono", OleDb.OleDbType.Integer).Value = DataGridView1.CurrentRow.Cells(0).Value Dim satir2 As OleDb.OleDbDataReader = komut3.ExecuteReader While satir2.Read b = satir2("ucret").ToString EndWhile con.Close() '---------------------------------------------------------------------- 'burada da b nin değeri 0 olduğu gozukuyor MsgBox("Ekleme Başarılı Yeni Tutar = " & b & " TL") '---------------------------------------------------------------------- con.Close() Else MsgBox("İptal Edildi", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Bilgi") con.Close() EndIf
__________________
Ben Nerde Hata Yaptım. Sql Sorgulama.. Vb.net
Programlama0 Mesaj
●28 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- Ben Nerde Hata Yaptım. Sql Sorgulama.. Vb.net