Merhaba Lütfiye
Bunun için bir örnek hazırladım sana umarım yardımcı olur
var MyForm: TclForm; CmbKullanicilar: TclComboBox; VeriSorgusu: TclSQliteQuery;
void VeritabaniniHazirla; { Clomosy.DBSQLiteConnect(Clomosy.AppFilesPath + 'BenimVeritabanim.db', ''); Clomosy.DBSQLiteQuery.Sql.Text = 'CREATE TABLE IF NOT EXISTS Kullanicilar (ID INTEGER PRIMARY KEY AUTOINCREMENT, KullaniciAdi VARCHAR(50))'; Clomosy.DBSQLiteQuery.OpenOrExecute; Clomosy.DBSQLiteQuery.Sql.Text = 'DELETE FROM Kullanicilar'; Clomosy.DBSQLiteQuery.OpenOrExecute; Clomosy.DBSQLiteQuery.Sql.Text = 'INSERT INTO Kullanicilar (KullaniciAdi) VALUES (''Ali Yılmaz''), (''Ayşe Demir''), (''Mehmet Kaya'')'; Clomosy.DBSQLiteQuery.OpenOrExecute; }
// VERİLERİ COMBOBOX BİLEŞENİNE BAĞLAMA void ComboBoxaVeriYukle; { VeriSorgusu = TclSQliteQuery.Create(Nil); VeriSorgusu.Connection = Clomosy.DBSQLiteConnection; VeriSorgusu.Sql.Text = 'SELECT ID, KullaniciAdi FROM Kullanicilar'; VeriSorgusu.OpenOrExecute; CmbKullanicilar.Clear; while (not VeriSorgusu.EOF) { CmbKullanicilar.AddItem(VeriSorgusu.FieldByName('KullaniciAdi').AsString, VeriSorgusu.FieldByName('ID').AsString); VeriSorgusu.Next; } VeriSorgusu.Free; }
{ MyForm = TclForm.Create(Self); MyForm.SetFormColor('#F8FAFC', '', clGNone); VeritabaniniHazirla; CmbKullanicilar = MyForm.AddNewComboBox(MyForm, 'CmbKullanicilar'); CmbKullanicilar.Align = alTop; CmbKullanicilar.Margins.Top = 50; CmbKullanicilar.Margins.Left = 20; CmbKullanicilar.Margins.Right = 20; ComboBoxaVeriYukle; MyForm.Run; } https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" integrity="sha512-8DS7rgIrAmghBFwoOTujcf6D9rXvH8xm8JQ1Ja01h9QX8EzXldiszufYa4IFfKdLUKTTrnSFXLDkUEOTrZQ8Qg==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">
|