ProListView ve SQL bağlantısı
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=808
Tarih: 07 Ocak 2025 Saat 23:23 Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com
Konu: ProListView ve SQL bağlantısı
Mesajı Yazan: zeynepsimsek
Konu: ProListView ve SQL bağlantısı
Mesaj Tarihi: 05 Ağustos 2024 Saat 13:14
void InsertToDatabase; { try Clomosy.DBSQLServerQuery.SQL.text= 'INSERT INTO KisiBilgileri (ID,Kisi,Yer,Tarih,KmDegeri,Konum) VALUES ( '+ProEdit6.Text+','+QuotedStr(ProEdit1.Text)+', '+QuotedStr(ProEdit2.Text)+','+QuotedStr(ProEdit3.Text)+', '+ProEdit4.Text+', '+QuotedStr(ProEdit5.Text)+')'; Clomosy.DBSQLServerQuery.ExecSql; ShowMessage('Veri Ekleme Başarılı.'); except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } }
Bu şekilde veritabanına başarılı bit şekilde ekleme yapabiliyorum. Ama ProListView içinde bu verileri görüntüleme konusunda sıkıntı yaşıyorum.
selectQuery.Sql.text =
nasıl bir kullanım yapmam gerektiğini anlayamadım. Yardımcı olur musunuz ?
|
Cevaplar:
Mesajı Yazan: zeynepsimsek
Mesaj Tarihi: 05 Ağustos 2024 Saat 14:04
void AddDataToListView; { try selectQuery.SQL.text = 'SELECT ID AS Kisi ID , Kisi AS Kisi İsmi, Yer AS Alindigi Yer, Tarih AS Alinma Zamani, KmDegeri AS Km Degeri, Konum AS Konumu FROM KisiBilgileri'; selectQuery.Open; if(selectQuery.Found) { ProListView.ClLoadProListViewDataFromDataset(selectQuery); } else { ShowMessage('Kayıt Bulunamadı!'); } finally selectQuery.Free; selectQuery.Close; }
KisiBilgileri isimli tablomda ID,Kisi,Yer,Tarih,KmDegeri,Konum sütunları bulunmakta. Bu sütunlara ekleme yaptığım bilgileri uygulamamdaki ProListView üzerinde göstermek istiyorum. Detaylı bir kullanım bulamadım. Fonksiyonum hata veriyor inceleyebilir misiniz?
|
Mesajı Yazan: Atiker01
Mesaj Tarihi: 05 Ağustos 2024 Saat 14:21
Merhaba Zeynep,
Veritabanından gelen sütun adları ile prolistview nesnesinin içerisinde oluşturulan nesnelerin isimleri aynı olmalıdır.
Örneğin, tabloda "Kisi" adından bir alan adın var. ProListView içerisinde "Kisi" adında nesnen olmalıdır.
Bu şekilde düzenlemeleri yapabilirsin. Geri dönüşünü bekliyorum.
|
Mesajı Yazan: zeynepsimsek
Mesaj Tarihi: 05 Ağustos 2024 Saat 15:01
RUNTIME ERROR Could not convert variant of type (Null) into type (Integer) when evaluating instruction CallProc ($FFFFFFFF,$2,$1320EA8,$6BF99A0,'AddNewProListViewDesignerPanel'). Stack content is: [Null,Null,Null,Null...]. Source position: 49,85 Position: 49, 85 Clomosy Build : 20240709.111531
49.SATIR DesignerPanel=MyForm.AddNewProListViewDesignerPanel(ProListView, 'DesignerPanel');
Dediğiniz gibi nesneleri tanımladım Şimdii böyle bir hata veriyor.
|
Mesajı Yazan: zeynepsimsek
Mesaj Tarihi: 05 Ağustos 2024 Saat 15:07
/* void AddDataToListView; { try selectQuery.SQL.text = 'SELECT ID AS Kisi ID , Kisi AS Kisi İsmi, Yer AS Alindigi Yer, Tarih AS Alinma Zamani, KmDegeri AS Km Degeri, Konum AS Konumu FROM KisiBilgileri'; selectQuery.Open; if(selectQuery.Found) { ProListView.ClLoadProListViewDataFromDataset(selectQuery); } else { ShowMessage('Kayıt Bulunamadı!'); } finally selectQuery.Free; selectQuery.Close; } */
/*DesignerPanel=MyForm.AddNewProListViewDesignerPanel(ProListView, 'DesignerPanel'); clComponent.SetupComponent(DesignerPanel,'{"Height":100,"Width" : 150,"BackgroundColor":"#F6EDDB", "BorderColor":"#F5BCC9","BorderWidth":2,"RoundHeight":20,"RoundWidth":20}'); ProListView.SetDesignerPanel(DesignerPanel); ID = MyForm.AddNewProLabel(DesignerPanel,'ID','ID'); clComponent.SetupComponent(ID, '{"Height":100, "Width" : 150, "BackgroundColor":"#f3d5aa", "BorderColor":"#ff9b0f", "BorderWidth":2, "RoundHeight":20, "RoundWidth":20}'); DesignerPanel.AddPanelObject(ID,Cltext); Kisi = MyForm.AddNewProLabel(DesignerPanel,'Kisi','Kisi İsmi'); clComponent.SetupComponent(Kisi, '{"Height":100, "Width" : 150, "BackgroundColor":"#f3d5aa", "BorderColor":"#ff9b0f", "BorderWidth":2, "RoundHeight":20, "RoundWidth":20}'); DesignerPanel.AddPanelObject(Kisi,Cltext); Yer = MyForm.AddNewProLabel(DesignerPanel,'Yer','Alındıgı Yer'); clComponent.SetupComponent(Yer, '{"Height":100, "Width" : 150, "BackgroundColor":"#f3d5aa", "BorderColor":"#ff9b0f", "BorderWidth":2, "RoundHeight":20, "RoundWidth":20}'); DesignerPanel.AddPanelObject(Yer,Cltext); Tarih = MyForm.AddNewProLabel(DesignerPanel,'Tarih','Alınma Zamani'); clComponent.SetupComponent(Tarih, '{"Height":100, "Width" : 150, "BackgroundColor":"#f3d5aa", "BorderColor":"#ff9b0f", "BorderWidth":2, "RoundHeight":20, "RoundWidth":20}'); DesignerPanel.AddPanelObject(Tarih,Cltext); KmDegeri = MyForm.AddNewProLabel(DesignerPanel,'KmDegeri','Kilometre Degeri'); clComponent.SetupComponent(KmDegeri, '{"Height":100, "Width" : 150, "BackgroundColor":"#f3d5aa", "BorderColor":"#ff9b0f", "BorderWidth":2, "RoundHeight":20, "RoundWidth":20}'); DesignerPanel.AddPanelObject(KmDegeri,Cltext); Konum= MyForm.AddNewProLabel(DesignerPanel,'Konum','Konumu'); clComponent.SetupComponent(Konum, '{"Height":100, "Width" : 150, "BackgroundColor":"#f3d5aa", "BorderColor":"#ff9b0f", "BorderWidth":2, "RoundHeight":20, "RoundWidth":20}'); DesignerPanel.AddPanelObject(Konum,Cltext); ProListView=MyForm.AddNewProListView(MyForm, 'ProListView'); clComponent.SetupComponent(ProListView,'{"Height" : 150 ,"Width": 150, "Align":"Client","MarginBottom":50,"MarginTop":380, "MarginRight":20,"MarginLeft":20, "ListType":"Cart","ItemHeight" : 50, "ItemWidth":50}'); ProListView.SetDesignerPanel(DesignerPanel); */
Bu iki kısım yokken kodum hatasız çalışıyor. Bunları devreye soktuğumda yukarıda bahsettiğim hatayı veriyor.
|
Mesajı Yazan: Developer
Mesaj Tarihi: 05 Ağustos 2024 Saat 17:49
Merhaba Zeynep, Bütün projeni paylaşır mısın?
|
Mesajı Yazan: zeynepsimsek
Mesaj Tarihi: 06 Ağustos 2024 Saat 01:20
Var MyForm:TclForm; Label1,adLbl,mekanLbl,zamanLbl,kmLbl,konumLbl,idLbl: TClProLabel; ProBtn1,ProBtn2,ProBtn3 : TClProButton; ProEdit1,ProEdit2,ProEdit3,ProEdit4,ProEdit5,ProEdit6:TclProEdit; ProListView : TClProListView; DesignerPanel : TClProListViewDesignerPanel; ID,Kisi,Yer,Tarih,KmDegeri,Konum:TClProLabel; selectQuery: TclSqlQuery; void AddDataToListView; // bu fonksiyon devreye girince hata veriyor { try selectQuery.SQL.text = 'SELECT ID AS Kisi ID , Kisi AS Kisi İsmi, Yer AS Alindigi Yer, Tarih AS Alinma Zamani, KmDegeri AS Km Degeri, Konum AS Konumu FROM KisiBilgileri'; selectQuery.Open; if(selectQuery.Found) { ProListView.ClLoadProListViewDataFromDataset(selectQuery); } else { ShowMessage('Kayıt Bulunamadı!'); } finally selectQuery.Free; selectQuery.Close; } void InsertToDatabase; //bu fonksiyonum başarılı veritabanına ekleme yapıyor { try Clomosy.DBSQLServerQuery.SQL.text= 'INSERT INTO KisiBilgileri (ID,Kisi,Yer,Tarih,KmDegeri,Konum) VALUES ( '+ProEdit6.Text+','+QuotedStr(ProEdit1.Text)+', '+QuotedStr(ProEdit2.Text)+','+QuotedStr(ProEdit3.Text)+', '+ProEdit4.Text+', '+QuotedStr(ProEdit5.Text)+')'; Clomosy.DBSQLServerQuery.ExecSql; ShowMessage('Veri Ekleme Başarılı.'); except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } }
{ MyForm = TclForm.Create(Self); MyForm.SetFormColor('#f5f0f0', '#c3d3da', clGVertical); DesignerPanel=MyForm.AddNewProListViewDesignerPanel(ProListView,'DesignerPanel'); clComponent.SetupComponent(DesignerPanel, '{"Height":100,"Width" : 150, "BackgroundColor":"#677b98", "BorderColor":"#2c5696", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); ProListView.SetDesignerPanel(DesignerPanel); ID = MyForm.AddNewProLabel(DesignerPanel,'ID',''); clComponent.SetupComponent(ID, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(ID,Cltext); Kisi = MyForm.AddNewProLabel(DesignerPanel,'Kisi',''); clComponent.SetupComponent(Kisi, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Kisi,Cltext); Yer = MyForm.AddNewProLabel(DesignerPanel,'Yer',''); clComponent.SetupComponent(Yer, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Yer,Cltext); Tarih = MyForm.AddNewProLabel(DesignerPanel,'Tarih',''); clComponent.SetupComponent(Tarih, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Tarih,Cltext); KmDegeri = MyForm.AddNewProLabel(DesignerPanel,'KmDegeri',''); clComponent.SetupComponent(KmDegeri, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(KmDegeri,Cltext); Konum= MyForm.AddNewProLabel(DesignerPanel,'Konum',''); clComponent.SetupComponent(Konum, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Konum,Cltext); ProListView=MyForm.AddNewProListView(MyForm, 'ProListView'); clComponent.SetupComponent(ProListView,'{"Height" : 120 ,"Width": 150, "Align":"Client","MarginBottom":50,"MarginTop":380, "MarginRight":20,"MarginLeft":20, "BackgroundColor":"#92a1aa", "ListType":"fluid","ItemHeight" : 50, "BorderColor":"#4c5c67", "BorderWidth":2 , "ItemWidth":50}'); ProListView.SetDesignerPanel(DesignerPanel); idLbl = MyForm.AddNewProLabel(MyForm,'idLbl','Kişi ID:'); clComponent.SetupComponent(idLbl,'{"MarginBottom":550,"MarginRight":130, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); adLbl = MyForm.AddNewProLabel(MyForm,'adLbl','Kişi İsmi:'); clComponent.SetupComponent(adLbl,'{"MarginBottom":450,"MarginRight":130, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); mekanLbl = MyForm.AddNewProLabel(MyForm,'mekanLbl','Alındığı Yer:'); clComponent.SetupComponent(mekanLbl,'{"MarginBottom":350,"MarginRight":145, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); zamanLbl = MyForm.AddNewProLabel(MyForm,'zamanLbl','Alınma Zamanı:'); clComponent.SetupComponent(zamanLbl,'{"MarginBottom":250,"MarginRight":170, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); kmLbl = MyForm.AddNewProLabel(MyForm,'kmLbl','Km Değeri:'); clComponent.SetupComponent(kmLbl,'{"MarginBottom":150,"MarginRight":140, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); konumLbl = MyForm.AddNewProLabel(MyForm,'konumLbl','Konumu:'); clComponent.SetupComponent(konumLbl,'{"MarginBottom":50,"MarginRight":135, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); ProBtn1=MyForm.AddNewProButton(MyForm, 'ProBtn1', 'Ekle'); clComponent.SetupComponent(ProBtn1,'{"caption":"Ekle","MarginTop":70, "Width" :50, "Height":35,"RoundHeight":2, "RoundWidth":2,"BorderColor":"#7A3E65","BorderWidth":2}'); ProBtn2=MyForm.AddNewProButton(MyForm, 'ProBtn2', 'Güncelle'); clComponent.SetupComponent(ProBtn2,'{"caption":"Güncelle","MarginTop":70, "MarginLeft":110, "Width" :50, "Height":35,"RoundHeight":2, "RoundWidth":2,"BorderColor":"#7A3E65","BorderWidth":2}'); ProBtn3=MyForm.AddNewProButton(MyForm, 'ProBtn3', 'Sil'); clComponent.SetupComponent(ProBtn3,'{"caption":"Sil","MarginTop":70,"MarginRight":110, "Width" :50, "Height":35,"RoundHeight":2, "RoundWidth":2,"BorderColor":"#7A3E65","BorderWidth":2}'); Label1 = MyForm.AddNewProLabel(MyForm,'Label1','ARAÇ TAKİP UYGULAMASI'); clComponent.SetupComponent(Label1,'{"Align" : "Center","MarginBottom":630,"Width" : 500, "Height":400,"TextColor":"#000000","TextSize":20,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); ProEdit1=MyForm.AddNewProEdit(MyForm, 'ProEdit1', ''); clComponent.SetupComponent(ProEdit1,'{"Align" : "Center","MarginBottom":450,"Width" :100 ,"Height":30,"MarginLeft":27}') ProEdit2=MyForm.AddNewProEdit(MyForm, 'ProEdit2', ''); clComponent.SetupComponent(ProEdit2,'{"Align" : "Center","MarginBottom":350,"Width" :100 ,"Height":30,"MarginLeft":27}'); ProEdit3=MyForm.AddNewProEdit(MyForm, 'ProEdit3', 'Yıl-Ay-Gün'); clComponent.SetupComponent(ProEdit3,'{"Align" : "Center","MarginBottom":250,"Width" :100 ,"Height":30,"MarginLeft":27}');
ProEdit4=MyForm.AddNewProEdit(MyForm, 'ProEdit4', ''); clComponent.SetupComponent(ProEdit4,'{"Align" : "Center","MarginBottom":150,"Width" :100 ,"Height":30,"MarginLeft":27}'); // ProEdit4.clTypeOfField=taFloat; ProEdit5=MyForm.AddNewProEdit(MyForm, 'ProEdit5', ''); clComponent.SetupComponent(ProEdit5,'{"Align" : "Center","MarginBottom":50,"Width" :100 ,"Height":30,"MarginLeft":27}'); ProEdit6=MyForm.AddNewProEdit(MyForm, 'ProEdit6', ''); clComponent.SetupComponent(ProEdit6,'{"Align" : "Center","MarginBottom":550,"Width" :100 ,"Height":30,"MarginLeft":27}'); MyForm.AddNewEvent(ProBtn1,tbeOnClick,'InsertToDatabase'); selectQuery = TclSqlQuery.Create(nil); Clomosy.DBSQLServerConnect('SQL Server', 'DESKTOP-T9RHDI8\SQLEXPRESS', 'sa', '1', 'AracTakip', 1433); selectQuery.Connection = Clomosy.DBSQLServerConnection; AddDataToListView; MyForm.Run; }
Designer panel kısmını ve üstteki fonksiyonu yorum satırına aldığımda her şey düzgünce çalışıyor.
|
Mesajı Yazan: BilalCndn
Mesaj Tarihi: 06 Ağustos 2024 Saat 15:32
Merhaba Zeynep,
Var MyForm:TclForm; Label1,adLbl,mekanLbl,zamanLbl,kmLbl,konumLbl,idLbl: TClProLabel; ProBtn1,ProBtn2,ProBtn3 : TClProButton; ProEdit1,ProEdit2,ProEdit3,ProEdit4,ProEdit5,ProEdit6:TclProEdit; ProListView : TClProListView; DesignerPanel : TClProListViewDesignerPanel; ID,Kisi,Yer,Tarih,KmDegeri,Konum:TClProLabel; selectQuery: TclSqlQuery; void AddDataToListView; // bu fonksiyon devreye girince hata veriyor { try selectQuery.SQL.text = 'SELECT ID AS Kisi ID , Kisi AS Kisi İsmi, Yer AS Alindigi Yer, Tarih AS Alinma Zamani, KmDegeri AS Km Degeri, Konum AS Konumu FROM KisiBilgileri'; selectQuery.Open; if(selectQuery.Found) { ProListView.ClLoadProListViewDataFromDataset(selectQuery); } else { ShowMessage('Kayıt Bulunamadı!'); } except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } } void InsertToDatabase; //bu fonksiyonum başarılı veritabanına ekleme yapıyor { try Clomosy.DBSQLServerQuery.SQL.text= 'INSERT INTO KisiBilgileri (ID,Kisi,Yer,Tarih,KmDegeri,Konum) VALUES ( '+ProEdit6.Text+','+QuotedStr(ProEdit1.Text)+', '+QuotedStr(ProEdit2.Text)+','+QuotedStr(ProEdit3.Text)+', '+ProEdit4.Text+', '+QuotedStr(ProEdit5.Text)+')'; Clomosy.DBSQLServerQuery.ExecSql; ShowMessage('Veri Ekleme Başarılı.'); except ShowMessage('Exception class: '+LastExceptionClassName+' Exception Message: ' +LastExceptionMessage); } }
{ MyForm = TclForm.Create(Self); MyForm.SetFormColor('#f5f0f0', '#c3d3da', clGVertical); ProListView=MyForm.AddNewProListView(MyForm, 'ProListView'); clComponent.SetupComponent(ProListView,'{"Height" : 120 ,"Width": 150, "Align":"Client","MarginBottom":50,"MarginTop":380, "MarginRight":20,"MarginLeft":20, "BackgroundColor":"#92a1aa", "ListType":"fluid","ItemHeight" : 50, "BorderColor":"#4c5c67", "BorderWidth":2 , "ItemWidth":50}'); DesignerPanel=MyForm.AddNewProListViewDesignerPanel(ProListView,'DesignerPanel'); clComponent.SetupComponent(DesignerPanel, '{"Height":100,"Width" : 150, "BackgroundColor":"#677b98", "BorderColor":"#2c5696", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); ID = MyForm.AddNewProLabel(DesignerPanel,'ID',''); clComponent.SetupComponent(ID, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(ID,Cltext); Kisi = MyForm.AddNewProLabel(DesignerPanel,'Kisi',''); clComponent.SetupComponent(Kisi, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Kisi,Cltext); Yer = MyForm.AddNewProLabel(DesignerPanel,'Yer',''); clComponent.SetupComponent(Yer, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Yer,Cltext); Tarih = MyForm.AddNewProLabel(DesignerPanel,'Tarih',''); clComponent.SetupComponent(Tarih, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Tarih,Cltext); KmDegeri = MyForm.AddNewProLabel(DesignerPanel,'KmDegeri',''); clComponent.SetupComponent(KmDegeri, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(KmDegeri,Cltext); Konum= MyForm.AddNewProLabel(DesignerPanel,'Konum',''); clComponent.SetupComponent(Konum, '{"Height":10, "Width" : 100, "BackgroundColor":"#a4a5a8", "BorderColor":"#7a4848", "BorderWidth":2, "RoundHeight":2, "RoundWidth":2}'); DesignerPanel.AddPanelObject(Konum,Cltext); ProListView.SetDesignerPanel(DesignerPanel); idLbl = MyForm.AddNewProLabel(MyForm,'idLbl','Kişi ID:'); clComponent.SetupComponent(idLbl,'{"MarginBottom":550,"MarginRight":130, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); adLbl = MyForm.AddNewProLabel(MyForm,'adLbl','Kişi İsmi:'); clComponent.SetupComponent(adLbl,'{"MarginBottom":450,"MarginRight":130, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); mekanLbl = MyForm.AddNewProLabel(MyForm,'mekanLbl','Alındığı Yer:'); clComponent.SetupComponent(mekanLbl,'{"MarginBottom":350,"MarginRight":145, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); zamanLbl = MyForm.AddNewProLabel(MyForm,'zamanLbl','Alınma Zamanı:'); clComponent.SetupComponent(zamanLbl,'{"MarginBottom":250,"MarginRight":170, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); kmLbl = MyForm.AddNewProLabel(MyForm,'kmLbl','Km Değeri:'); clComponent.SetupComponent(kmLbl,'{"MarginBottom":150,"MarginRight":140, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); konumLbl = MyForm.AddNewProLabel(MyForm,'konumLbl','Konumu:'); clComponent.SetupComponent(konumLbl,'{"MarginBottom":50,"MarginRight":135, "Width" : 500, "Height":400,"TextColor":"#000000","TextSize":14,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); ProBtn1=MyForm.AddNewProButton(MyForm, 'ProBtn1', 'Ekle'); clComponent.SetupComponent(ProBtn1,'{"caption":"Ekle","MarginTop":70, "Width" :50, "Height":35,"RoundHeight":2, "RoundWidth":2,"BorderColor":"#7A3E65","BorderWidth":2}'); ProBtn2=MyForm.AddNewProButton(MyForm, 'ProBtn2', 'Güncelle'); clComponent.SetupComponent(ProBtn2,'{"caption":"Güncelle","MarginTop":70, "MarginLeft":110, "Width" :50, "Height":35,"RoundHeight":2, "RoundWidth":2,"BorderColor":"#7A3E65","BorderWidth":2}'); ProBtn3=MyForm.AddNewProButton(MyForm, 'ProBtn3', 'Sil'); clComponent.SetupComponent(ProBtn3,'{"caption":"Sil","MarginTop":70,"MarginRight":110, "Width" :50, "Height":35,"RoundHeight":2, "RoundWidth":2,"BorderColor":"#7A3E65","BorderWidth":2}'); Label1 = MyForm.AddNewProLabel(MyForm,'Label1','ARAÇ TAKİP UYGULAMASI'); clComponent.SetupComponent(Label1,'{"Align" : "Center","MarginBottom":630,"Width" : 500, "Height":400,"TextColor":"#000000","TextSize":20,"TextVerticalAlign":"center", "TextHorizontalAlign":"center"}'); ProEdit1=MyForm.AddNewProEdit(MyForm, 'ProEdit1', ''); clComponent.SetupComponent(ProEdit1,'{"Align" : "Center","MarginBottom":450,"Width" :100 ,"Height":30,"MarginLeft":27}') ProEdit2=MyForm.AddNewProEdit(MyForm, 'ProEdit2', ''); clComponent.SetupComponent(ProEdit2,'{"Align" : "Center","MarginBottom":350,"Width" :100 ,"Height":30,"MarginLeft":27}'); ProEdit3=MyForm.AddNewProEdit(MyForm, 'ProEdit3', 'Yıl-Ay-Gün'); clComponent.SetupComponent(ProEdit3,'{"Align" : "Center","MarginBottom":250,"Width" :100 ,"Height":30,"MarginLeft":27}');
ProEdit4=MyForm.AddNewProEdit(MyForm, 'ProEdit4', ''); clComponent.SetupComponent(ProEdit4,'{"Align" : "Center","MarginBottom":150,"Width" :100 ,"Height":30,"MarginLeft":27}'); // ProEdit4.clTypeOfField=taFloat; ProEdit5=MyForm.AddNewProEdit(MyForm, 'ProEdit5', ''); clComponent.SetupComponent(ProEdit5,'{"Align" : "Center","MarginBottom":50,"Width" :100 ,"Height":30,"MarginLeft":27}'); ProEdit6=MyForm.AddNewProEdit(MyForm, 'ProEdit6', ''); clComponent.SetupComponent(ProEdit6,'{"Align" : "Center","MarginBottom":550,"Width" :100 ,"Height":30,"MarginLeft":27}'); MyForm.AddNewEvent(ProBtn1,tbeOnClick,'InsertToDatabase'); selectQuery = TclSqlQuery.Create(nil); Clomosy.DBSQLServerConnect('SQL Server', 'DESKTOP-T9RHDI8\SQLEXPRESS', 'sa', '1', 'AracTakip', 1433); selectQuery.Connection = Clomosy.DBSQLServerConnection; AddDataToListView; MyForm.Run; }
|
Bu şekilde dener misin?
------------- Bilal Candan
Atiker Yazılım Veri İşlem A.Ş. Software Developer
[email protected]
|
Mesajı Yazan: zeynepsimsek
Mesaj Tarihi: 06 Ağustos 2024 Saat 15:37
Exception Class : EUniError Exception Message : Incorrect syntax near 'ID'. kod clomosyde çalıştı ama sanırım sql taraından böyle bir hata alıyorum.
|
Mesajı Yazan: zeynepsimsek
Mesaj Tarihi: 06 Ağustos 2024 Saat 15:42
selectQuery.SQL.text = 'SELECT ID AS [Kisi ID], Kisi AS [Kisi İsmi], Yer AS [Alindigi Yer], Tarih AS [Alinma Zamani], KmDegeri AS [Km Degeri], Konum AS [Konumu] From KisiBilgileri'; selectQuery.Open;
bu şekilde yazınca düzeldi teşekkür ederim.
|
|