Sayfayı Yazdır | Pencereyi Kapat

Veri çekme

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Genel Programlama
Forum Adı: Genel İşlemler
Forum Tanımlaması: TRObject dili ile programlama yaparken karşılaşılan genel işlemler
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=810
Tarih: 08 Ocak 2025 Saat 20:32
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: Veri çekme
Mesajı Yazan: rabiagnbs
Konu: Veri çekme
Mesaj Tarihi: 05 Ağustos 2024 Saat 17:13
burada sqlite'da bulunan veriyi edite yazdığımda panelde görüntülemek istiyorum nasıl devam edebilirim hata alıyorum: 
void HedefGoruntuleSayfa;
{
  hedefGoruntule=TclStyleForm.Create(self);
  hedefGoruntule.SetFormBGImage(' https://i.pinimg.com/originals/6d/c4/9a/6dc49af11ec6d6147b27b950e1c090b9.jpg" rel="nofollow - https://i.pinimg.com/originals/6d/c4/9a/6dc49af11ec6d6147b27b950e1c090b9.jpg ');
  
  hedefAra=hedefGoruntule.AddNewProEdit(hedefGoruntule, 'hedefAra', 'Ülke İsmi');
  clComponent.SetupComponent(hedefAra,'{
  "MarginTop":50,
  "Width" :300, 
  "Height":40,
  "TextColor":"#12366b",
  "TextSize":20,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"#f8f8f8"
  }');
  
  hedefGoruntulePanel1=hedefGoruntule.AddNewProPanel(hedefGoruntule,'hedefGoruntulePanel1');
  clComponent.SetupComponent(hedefGoruntulePanel1,
  '{
  "MarginTop":300,
  "Width" :350, 
  "Height":500,
  "RoundHeight":20,
  "RoundWidth":20,
  "BackGroundColor":"#f8f8f8"
  }');
  

  
  
  try
    Qry = Clomosy.DBSQLiteQueryWith('SELECT goal_city, goal_city, goal_date, goal_place, goal_item FROM Goals WHERE goal_country = '+ QuotedStr(hedefAra.Text));
    Qry.OpenOrExecute;
    hedefGoruntulePanel1.clLoadListViewDataFromDataset(Qry);
  except
    ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage);
  } 
  
  
  hedefGoruntule.Run;
}
  


-------------
RabiaGnbs



Cevaplar:
Mesajı Yazan: Developer
Mesaj Tarihi: 05 Ağustos 2024 Saat 17:42
Merhaba Rabia 
Kodun hepsini atabilir misin ?


Mesajı Yazan: rabiagnbs
Mesaj Tarihi: 05 Ağustos 2024 Saat 17:43
biraz uzun ama atıyım:

var
  seyahatHedef, hedefGoruntule: TclStyleForm;
  seyahatHedefPanel1, hedefGoruntulePanel1: TclProPanel;
  today: TclDateTime;
  tarih, hedefLabel: TClProLabel;
  tarihYazi: String;
  hedefUlke, hedefSehir, hedefGezi, hedefEsya, hedefAra: TclProEdit;
  hedefZaman: TclDateTime;
  gunH,ayH,yilH, dogruTarihH: TclString;
  VerticalScrollBox: TclVertScrollBox;
  seyahatHedefKayit, hedefGoruntuleButton: TClProButton;
  database, password : String;
  hedefListView : TClListView;
  Qry : TClSQLiteQuery;
  
void HedefKayit;
{
  try
    Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO Goals (goal_country, goal_city, goal_date, goal_place, goal_item) VALUES ('+QuotedStr(hedefUlke.Text)+', '+QuotedStr(hedefSehir.Text)+',
    '+QuotedStr(hedefZaman.Text)+','+QuotedStr(hedefGezi.Text)+','+QuotedStr(hedefEsya.Text)+')';
    Clomosy.DBSQLiteQuery.OpenOrExecute;
    ShowMessage('Seyahat Hedefleriniz Başarılı Bir Şekilde Eklenmiştir✅');
  except
    ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage);
  } 
}

void HedefGoruntuleSayfa;
{
  hedefGoruntule=TclStyleForm.Create(self);
  hedefGoruntule.SetFormBGImage(' https://i.pinimg.com/originals/6d/c4/9a/6dc49af11ec6d6147b27b950e1c090b9.jpg" rel="nofollow - https://i.pinimg.com/originals/6d/c4/9a/6dc49af11ec6d6147b27b950e1c090b9.jpg ');
  
  hedefAra=hedefGoruntule.AddNewProEdit(hedefGoruntule, 'hedefAra', 'Ülke İsmi');
  clComponent.SetupComponent(hedefAra,'{
  "MarginTop":50,
  "Width" :300, 
  "Height":40,
  "TextColor":"#12366b",
  "TextSize":20,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"#f8f8f8"
  }');
  
  hedefGoruntulePanel1=hedefGoruntule.AddNewProPanel(hedefGoruntule,'hedefGoruntulePanel1');
  clComponent.SetupComponent(hedefGoruntulePanel1,
  '{
  "MarginTop":300,
  "Width" :350, 
  "Height":500,
  "RoundHeight":20,
  "RoundWidth":20,
  "BackGroundColor":"#f8f8f8"
  }');
  

  
  
  try
    Qry = Clomosy.DBSQLiteQueryWith('SELECT goal_city, goal_city, goal_date, goal_place, goal_item FROM Goals WHERE goal_country = '+ QuotedStr(hedefAra.Text));
    Qry.OpenOrExecute;
    hedefGoruntulePanel1.clLoadListViewDataFromDataset(Qry);
  except
    ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage);
  } 
  
  
  hedefGoruntule.Run;
}
  
  
{
  seyahatHedef=TclStyleForm.Create(self);
  seyahatHedef.SetFormBGImage(' https://i.pinimg.com/originals/6d/c4/9a/6dc49af11ec6d6147b27b950e1c090b9.jpg" rel="nofollow - https://i.pinimg.com/originals/6d/c4/9a/6dc49af11ec6d6147b27b950e1c090b9.jpg ');
  
  Clomosy.DBSQLiteConnect(Clomosy.AppFilesPath + 'ClomosyDatabase.db3', '');
  
  seyahatHedefPanel1=seyahatHedef.AddNewProPanel(seyahatHedef,'seyahatHedefPanel1');
  clComponent.SetupComponent(seyahatHedefPanel1,
  '{
  "MarginBottom":100,
  "MarginTop":100,
  "Width" :350, 
  "Height":500,
  "RoundHeight":20,
  "RoundWidth":20,
  "BackGroundColor":"null"
  }');
  
  VerticalScrollBox = seyahatHedef.AddNewVertScrollBox(seyahatHedefPanel1,'ScrollY');
  VerticalScrollBox.Align = alMostTop;
  VerticalScrollBox.Height = TForm(seyahatHedef).clientHeight;
  
  
  hedefLabel=seyahatHedef.AddNewProLabel(seyahatHedef,'hedefLabel','Bu yıl için seyahat hedeflerini giriniz:');
  clComponent.SetupComponent(hedefLabel,'{
  "MarginTop":50,
  "MarginBottom":700,
  "Width" :400, 
  "Height":40,
  "TextColor":"#133f87",
  "TextSize":18,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#6f86d1",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"null"
  }');
  
   hedefUlke=seyahatHedef.AddNewProEdit(VerticalScrollBox, 'hedefUlke', 'Gitmeyi hedeflediğiniz ülke nedir?');
   clComponent.SetupComponent(hedefUlke,'{
  "MarginBottom": 1200,
  "Width" :300, 
  "Height":40,
  "TextColor":"#12366b",
  "TextSize":20,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"#f8f8f8"
  }');
   
   hedefSehir=seyahatHedef.AddNewProEdit(VerticalScrollBox, 'hedefSehir', 'Gitmeyi hedeflediğiniz şehir nedir?');
   clComponent.SetupComponent(hedefSehir,'{
  "MarginBottom": 1100,
  "Width" :300, 
  "Height":40,
  "TextColor":"#12366b",
  "TextSize":18,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"#f8f8f8"
  }');
   
  hedefZaman = seyahatHedef.AddNewProDateEdit(VerticalScrollBox, 'hedefZaman');
  clComponent.SetupComponent(hedefZaman,'{
   "MarginBottom":900,
   "Width" :300, 
   "Height":40,
   "TextColor":"#12366b",
   "TextSize":18,
   "TextVerticalAlign":"center",
   "TextHorizontalAlign":"center",
   "TextBold":"yes",
   "BorderColor":"#ffffff",
   "RoundHeight":20,
   "RoundWidth":20,
   "BorderWidth":1,
   "BackGroundColor":"#f8f8f8"
   }');
   
  
  hedefGezi=seyahatHedef.AddNewProEdit(VerticalScrollBox, 'hedefGezi', 'Gezmek istediğiniz yerler neler?');
  clComponent.SetupComponent(hedefGezi,'{
  "MarginBottom": 800,
  "Width" :300, 
  "Height":40,
  "TextColor":"#12366b",
  "TextSize":18,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"#f8f8f8"
  }');
  
  hedefEsya=seyahatHedef.AddNewProEdit(VerticalScrollBox, 'hedefEsya', 'Seyahatinizde Almak istediğiniz eşyalar neler?');
  clComponent.SetupComponent(hedefEsya,'{
  "MarginBottom": 700,
  "Width" :300, 
  "Height":40,
  "TextColor":"#12366b",
  "TextSize":18,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"#f8f8f8"
  }');
  
  tarih=seyahatHedef.AddNewProLabel(VerticalScrollBox,'tarih','Gitmek istediğiniz tarihi giriniz:');
  clComponent.SetupComponent(tarih,'{
  "MarginBottom":1000,
  "Width" :300, 
  "Height":40,
  "TextColor":"#12366b",
  "TextSize":15,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"#f8f8f8"
  }');
   
  gunH = clGetStringTo(hedefZaman.Date,'.');
  yilH = clGetStringAfter(hedefZaman.Date, '.');
  ayH = clGetStringTo(yilH, '.');
  yilH = clGetStringAfter(yilH, '.');
  
  dogruTarihH = yilH + '-' + ayH + '-' + gunH;
  
  
  seyahatHedefKayit=seyahatHedef.AddNewProButton(VerticalScrollBox, 'seyahatHedefKayit', 'Hedeflerinizi Kaydedin');
  clComponent.SetupComponent(seyahatHedefKayit,'{
  "MarginBottom":600,
  "Width" :300, 
  "Height":40,
  "TextColor":"#f3f3f3",
  "TextSize":15,
  "TextVerticalAlign":"center",
  "TextHorizontalAlign":"center",
  "TextBold":"yes",
  "BorderColor":"#ffffff",
  "RoundHeight":20,
  "RoundWidth":20,
  "BorderWidth":1,
  "BackGroundColor":"null"
  }');
  
  seyahatHedef.AddNewEvent(seyahatHedefKayit,tbeOnClick,'HedefKayit');
  
  
  hedefGoruntuleButton=seyahatHedef.AddNewProButton(VerticalScrollBox, 'hedefGoruntuleButton', 'Hedefleri Görüntüle');
  clComponent.SetupComponent(hedefGoruntuleButton,'{
  "MarginBottom":200,
  "Width" :300, 
  "Height":40,
  "TextColor":"#e4e0f3",
  "TextSize":15,
  "TextBold":"yes",
  "BorderColor":"#6f86d1",
  "RoundHeight":10,
  "RoundWidth":10,
  "BorderWidth":1,
  "BackGroundColor":"null"
  }');
  
  seyahatHedef.AddNewEvent(hedefGoruntuleButton, tbeOnClick, 'HedefGoruntuleSayfa');
  
  seyahatHedef.Run;
}



-------------
RabiaGnbs


Mesajı Yazan: Developer
Mesaj Tarihi: 05 Ağustos 2024 Saat 17:57
Merhaba Rabia
hedefGoruntulePanel1.clLoadListViewDataFromDataset(Qry); bu kodlama satırında panele veri yüklemeye çalışıyprsunuz. Böyle bir şey mümkün değil.


Mesajı Yazan: rabiagnbs
Mesaj Tarihi: 05 Ağustos 2024 Saat 17:59
aslında sadece buraya bakmanız yeterli. Örneğin burada show message üzerinde yazdırıyorum ama select sorgusu görüntüleniyor. ben bilgilerin gelmesini istiyorum. : 
  
void getData;
{
    try
    Qry = Clomosy.DBSQLiteQueryWith('SELECT goal_city, goal_city, goal_date, goal_place, goal_item FROM Goals WHERE goal_country = '+ QuotedStr(hedefAra.Text));
    Qry.OpenOrExecute;
    ShowMessage(Qry.Text);
  except
    ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage);
  } 
  
}


-------------
RabiaGnbs


Mesajı Yazan: Developer
Mesaj Tarihi: 05 Ağustos 2024 Saat 18:17
Merhaba Rabia
Aşağıdaki kodu inceler misin:
void getData;
{
    try
    Qry = Clomosy.DBSQLiteQueryWith('SELECT goal_city, goal_city, goal_date, goal_place, goal_item FROM Goals WHERE goal_country = '+ QuotedStr(hedefAra.Text));
    Qry.OpenOrExecute;
 
 
 for i = 0 to Qry.RecordCount-1   //i tanımlamayı unutma
        {
   ShowMessage(Qry.FieldByName('goal_city').AsString);
 }
 
  except
    ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage);
  } 
  
}



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net