prototype Posted July 21, 2012 Share Posted July 21, 2012 Arkadaşlar TreeList(Plugin)'den seçilen veriyi veritabanından silmek istiyorum ancak aşağıdaki hatayı alıyorum; [center][img]http://img201.imageshack.us/img201/1206/hataaj.png[/img][/center] Hatada gösterilen butonun kodları [code] secilen = TreeList.GetSelected("liste"); id = TreeList.GetRowData("liste", secilen[1]); SQLite3Connection, err = SQLite3:connect("C:\\database.db"); SQLite3Cursor, err = SQLite3Connection:execute("delete from siteler where id="..id..""); Dialog.TimedMessage("Dikkat !", "Site silindi !", 1500, MB_ICONINFORMATION); [/code] Hatayı verdiği satır 2 yani; [code]id = TreeList.GetRowData("liste", secilen[1]);[/code] burada ne gibi bir hata yapmış olabilirim. Treelist(plugin) konusunda yeniyim ve acemeyim. Yardımlarınızı bekliyorum . Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted July 21, 2012 Share Posted July 21, 2012 [code]id = TreeList.GetRowData("liste", secilen);[/code] [color="#8B0000"]bu şekilde dene. Seçilen tablo olarak değil de number olarak dönüyor sanırım.[/color] Quote Link to comment Share on other sites More sharing options...
prototype Posted July 21, 2012 Author Share Posted July 21, 2012 Verdiğin kodu denedim hata vermedi ancak veriyi veritabanından silmedi . Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted July 21, 2012 Share Posted July 21, 2012 (edited) SQL kısmında sıkıntı vardır o zaman, o konuda bilgim yok. Ama şöyle birşey dene ; [codebox] secilen = TreeList.GetSelected("liste"); id = TreeList.GetRowData("liste", secilen); SQLite3Connection, err = SQLite3:connect("C:\\database.db"); SQLite3Cursor, err = SQLite3Connection:execute("delete from siteler where id="..id); Dialog.TimedMessage("Dikkat !", "Site silindi !", 1500, MB_ICONINFORMATION); [/codebox] O da olmazsa rowdata belki boş dönüyordur. Onu da labelle veya dialog.message ile falan bi test et. Edited July 21, 2012 by DivaneTR Quote Link to comment Share on other sites More sharing options...
prototype Posted July 21, 2012 Author Share Posted July 21, 2012 İşe yaramadı maalesef Quote Link to comment Share on other sites More sharing options...
prototype Posted July 21, 2012 Author Share Posted July 21, 2012 (edited) Silme işlemini neden yapmadığını çözebildim. Hata bu kodda mevcut; [code]secilen = TreeList.GetSelected("liste"); id = TreeList.GetRowData("liste", secilen[1]);[/code] Burada kullanılan kodlarla seçilen verinin sayısal değerini alamadığını için veritabanından silmiyor. Ancak sadece silme kodunu kullanıp sayısal değerini elle girince siliyor. [code]SQLite3Connection, err = SQLite3:connect("C:\\database.db"); SQLite3Cursor, err = SQLite3Connection:execute("delete from siteler where id="..id); Dialog.TimedMessage("Dikkat !", "Site silindi !", 1500, MB_ICONINFORMATION);[/code] Şuan sorun seçilen verinin sayısal değerini alabilirsek (ki ben beceremedim) giderilmiş olacak. Edited July 21, 2012 by prototype Quote Link to comment Share on other sites More sharing options...
Sistemci Posted July 28, 2012 Share Posted July 28, 2012 (edited) kardesim apz dosyasini paylasirsan yardimci olabilirim sana Edited July 28, 2012 by Sistemci Quote Link to comment Share on other sites More sharing options...
korasoglu Posted August 2, 2012 Share Posted August 2, 2012 Şunu Globale yaz Bak = ""; Birde şu satıra iyi bak tablo ismi doğru olsun ("DELETE FROM kayit (parantez dahil yok Bende tablonun adı kayit seninki ne ise onu yazacaksın )WHERE id='" .. Bak .. "'"); liste = TreeList.GetSelected("Plugin1"); isa = TreeList.GetCellText("Plugin1", liste, 1); if isa == "" then Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\Hata.wav", true, false); result = Dialog.Message("Selam", "Silinecek kaydı seçmediniz", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); Page.Jump("Anasayfa") else end local nRow = TreeList.GetSelected("Plugin1") if nRow ~= -1 then local Sorunyok = TreeList.GetCellText("Plugin1", nRow, 2) if Sorunyok ~= "" then Bak = TreeList.GetCellText("Plugin1", nRow, 0) Bak = String.ToNumber(Bak) Veri = TreeList.GetCellText("Plugin1", nRow, 1) Mesaj = Dialog.Message("Selam", Veri .. " adlı kişiyi silmek istiyor musunuz?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1) if Mesaj == IDYES then SQLite3Cursor, err = SQLite3Connection:execute("DELETE FROM kayit WHERE id='" .. Bak .. "'"); if not SQLite3Cursor and err then Dialog.Message("hata", err) else Page.Jump("AnaSayfa") end end end end Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 6, 2012 Share Posted August 6, 2012 Bunu yapabilmeniz için Listeye verileri yüklerken TreeList.SetRowData() ile id'yi atmanız lazım. Eğer sorun halen devam ediyorsa proje dosyanızı verin düzenleyeyim. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 6, 2012 Share Posted August 6, 2012 PM ile gelen projede şu şekilde düzeltmeler yapıldı: [u]DialogEx On Show:[/u] [codebox]result = TreeList.AddColumn("liste", "Site Adı", 200); result = TreeList.AddColumn("liste", "Site Adresi", 200); result = TreeList.AddColumn("liste", "Kullanıcı Adı", 200); result = TreeList.AddColumn("liste", "Şifre", 195); SQLite3Connection, err = SQLite3:connect("Data\\database.db"); SQLite3Cursor, err = SQLite3Connection:execute("SELECT * FROM siteler"); satir = SQLite3Cursor:fetch({},"a"); while satir do result = TreeList.AddRow("liste", satir.siteadi.. "|"..satir.siteadresi.."|"..satir.kullaniciadi.."|"..satir.sifre, nil, nil, satir.id); satir = SQLite3Cursor:fetch(satir,"a"); end[/codebox] [u]DialogEx'teki Sil buttonu On Click evresi:[/u] [codebox]nCount = TreeList.CountRows("liste") if nCount ~= 0 then SeciliSayisi = 0; for i=0,nCount-1 do bSecili = TreeList.GetRowChecked("liste", i) if bSecili then SeciliSayisi = 1 nID = TreeList.GetRowData("liste", i) SQLite3Connection, err = SQLite3:connect("Data\\database.db"); SQLite3Cursor, err = SQLite3Connection:execute("delete from siteler where id="..nID..""); end end if SeciliSayisi ~= 0 then Dialog.TimedMessage("Dikkat !", "Seçili siteler silindi !", 1500, MB_ICONINFORMATION); TreeList.ClearRows("liste") SQLite3Connection, err = SQLite3:connect("Data\\database.db"); SQLite3Cursor, err = SQLite3Connection:execute("SELECT * FROM siteler"); satir = SQLite3Cursor:fetch({},"a"); while satir do result = TreeList.AddRow("liste", satir.siteadi.. "|"..satir.siteadresi.."|"..satir.kullaniciadi.."|"..satir.sifre, nil, nil, satir.id); satir = SQLite3Cursor:fetch(satir,"a"); end else Dialog.TimedMessage("Dikkat !", "Önce seçim yapın!", 1500, MB_ICONEXCLAMATION); end end [/codebox] Quote Link to comment Share on other sites More sharing options...
prototype Posted August 7, 2012 Author Share Posted August 7, 2012 Sağol üstad ancak bir problemim daha var Veritabanından düzenleme işleminde hata alıyorum .. [left][img]http://www.fileden.com/files/2012/6/29/3321548//hata.png[/img][/left] Müşteri Düzenle sayfasındaki On Show sekmesinde bulunan kodlar; [code] SQLite3Connection, err = SQLite3:connect("Database\\database.db", "", "") SQLite3Cursor, err = SQLite3Connection:execute("SELECT * FROM musteriler WHERE id='" .. sKayitID .. "'") if SQLite3Cursor ~= nil then tVeriler = SQLite3Cursor:fetch({},"a"); Input.SetText("adi", tVeriler.adi) Input.SetText("soyadi", tVeriler.soyadi) Input.SetText("mevkisi", tVeriler.mevkisi) Input.SetText("risklimiti", tVeriler.risklimiti) Input.SetText("telefonu", tVeriler.telefonu) Input.SetText("ceptelefonu", tVeriler.ceptelefonu) Input.SetText("vergidairesi", tVeriler.vergidairesi) Input.SetText("vergino", tVeriler.vergino) end [/code] Müşteri Düzenle butonundaki kodlar; [code] nRow = TreeList.GetSelected("musterilistesi") if nRow ~= -1 then sKayitID = TreeList.GetCellText("musterilistesi", nRow, 0) sKayitID = String.ToNumber(sKayitID) sKayitID = sKayitID-100 DialogEx.Show("musteriduzenle") end [/code] Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 10, 2012 Share Posted August 10, 2012 [quote]sKayitID = sKayitID-100[/quote] bunu yazmanda ki amaç nedir? bence bu kodu kaldırırsan sorun düzelir. Quote Link to comment Share on other sites More sharing options...
prototype Posted August 11, 2012 Author Share Posted August 11, 2012 (edited) Üstad bu düzenleme kodunu senin hazırlamış olduğun Telefon Rehberi adlı çalışmadan aldım. Söylediğin kodu kaldırdım aynı hatayı vermeye devam ediyor. Edited August 11, 2012 by prototype Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 11, 2012 Share Posted August 11, 2012 [quote]sKayitID = TreeList.GetCellText("musterilistesi", nRow, 0[/quote] bu satırı [quote]sKayitID = TreeList.GetRowData("musterilistesi", nRow)[/quote] bunla değiştir. Quote Link to comment Share on other sites More sharing options...
jive Posted August 12, 2012 Share Posted August 12, 2012 Son halini ya da apz sini paylaşırsanız belki bizim de işimize yaradı sayın [color="#FF8C00"] prototype [/color] Teşekkürler Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.