Clomosy Resmi Forum Sitesidir. Amacımız kullanıcılarımıza, iş ortaklarımıza, danışmanlara, yazılımcılara programlarımız hakkında destek ve bilgi vermektir. |
alınan hata kodu |
Yanıt Yaz |
Yazar | |
kader
Yeni Üye Kayıt Tarihi: 26 Temmuz 2023 Durum: Aktif Değil Puanlar: 11 |
Mesaj Seçenekleri
Teşekkürler(0)
Gönderim Zamanı: 10 Ağustos 2023 Saat 15:03 |
1.kısım
var MyForm:TclForm; mainRow,mainCol1:TCLPanel; stokKoduLbl,StokAdiLbl,stokGirisMiktariLbl:TCLLabel; stokKoduEdt,stokAdiEdt,stokGirisMiktariEdt:TCLEdit; stokKoduSection,StokAdiSection,stokGirisMiktariSection,SendBtnSection,AciklamaSection:TCLLAyout; SendBtn:TCLButton; testButton,testButton1,testButton2,testButton3: TclButton; testPanelRow : TclPanel; testEdit : TclEdit; testLayout : TclLayout; procedure eklebtn; var clViewDataQuery :TclSQLQuery; begin if (stokKoduEdt.text='') or (stokAdiEdt.text='') or (stokGirisMiktariEdt.text='') then begin ShowMessage('Veri boş kaydedilemez!'); exit; end; else begin clViewDataQuery:=TclSQLQuery.Create(Nil); Try clViewDataQuery.Connection := Clomosy.DBSQLServerConnection; clViewDataQuery.SQL.Text :=' INSERT tblstok(kodu,adi,alisfiyati) VALUES ('+QuotedStr(stokKoduEdt.Text)+','+QuotedStr(stokAdiEdt.Text)+','+QuotedStr(stokGirisMiktariEdt.Text)+')'; clViewDataQuery.ExecSql; finally clViewDataQuery.Free; End; Clomosy.RunUnit('veri'); end; end; procedure SetupSqlConnection; begin Clomosy.DBSQLServerConnect('SQL Server','192.168.2.40','sa','kader123','stoktakibi',50000); end; begin Clomosy.ResumeLocalEvent := False; MyForm:=TclForm.Create(self); mainRow:=MyForm.AddNewPanel(MyForm,'mainRow',''); mainRow.Align:=ALCenter; mainRow.Height:=275; mainRow.StyleLookup:='pushpanel'; mainCol1:=MyForm.AddNewPanel(mainRow,'mainCol1',''); mainCol1.Align:=ALCenter; mainCol1.Width:=300; mainCol1.Height:=275; stokKoduSection:=MyForm.AddNewLayout(mainCol1,'stokKodu'); With stokKoduSection Do Begin Align:=ALMostTop; Width:=300; Height:=50; end; stokKoduLbl:=MyForm.AddNewLabel(stokKoduSection,'stokKoduLbl','stokKodu:'); With stokKoduLbl Do Begin StyledSettings := ssFamily; TextSettings.Font.Size:=15; Align:=ALMostLeft; AutoSize:=True; TextSettings.WordWrap:=True; Margins.Left:=10; end; stokKoduEdt:=MyForm.AddNewEdit(stokKoduSection,'stokKoduEdt',''); With stokKoduEdt Do Begin Height:=30; width:=160; end; stokAdiSection:=MyForm.AddNewLayout(mainCol1,'stokAdi'); With StokAdiSection Do Begin Align:=ALMostTop; Width:=300; Height:=50; end; StokAdiLbl:=MyForm.AddNewLabel(stokAdiSection,'StokAdiLbl','StokAdi:'); With StokAdiLbl Do Begin StyledSettings := ssFamily; TextSettings.Font.Size:=15; Align:=ALMostLeft; AutoSize:=True; TextSettings.WordWrap:=True; Margins.Left:=10; end; StokAdiEdt:=MyForm.AddNewEdit(StokAdiSection,'StokAdiEdt',''); With StokAdiEdt Do Begin Height:=30; Width:=160; end; stokGirisMiktariSection:=MyForm.AddNewLayout(mainCol1,'stokGirisMiktariSection'); With stokGirisMiktariSection Do Begin Align:=ALMostTop; Width:=300; Height:=50; end; stokGirisMiktariLbl:=MyForm.AddNewLabel(stokGirisMiktariSection,'stokGirisMiktariLbl','stokGirisMiktari:'); With stokGirisMiktariLbl Do Begin StyledSettings := ssFamily; TextSettings.Font.Size:=15; Align:=ALMostLeft; AutoSize:=True; TextSettings.WordWrap:=True; Margins.Left:=10; end; stokGirisMiktariEdt:=MyForm.AddNewEdit(stokGirisMiktariSection,'stokGirisMiktariEdt',''); With stokGirisMiktariEdt Do Begin Height:=30; Width:=160; MaxLength:=10; end; testButton:= MyForm.AddNewButton(MyForm,'testButton','EKLE'); testButton.TextSettings.Font.Size:=50; testButton.Align := alCenter; testButton.Height := 50; testButton.Width := 100; testButton.Margins.right:=200; testButton.Margins.top:=200; MyForm.AddNewEvent(testButton,tbeOnClick,'eklebtn'); testButton1:= MyForm.AddNewButton(MyForm,'testButton1','GÜNCELLE'); testButton1.TextSettings.Font.Size:=50; testButton1.Align := alCenter; testButton1.Height := 50; testButton1.Width := 100; testButton1.Margins.left:=0; testButton1.Margins.top:=200; MyForm.AddNewEvent(testButton1,tbeOnClick,' '); testButton2:= MyForm.AddNewButton(MyForm,'testButton2','SİL'); testButton2.TextSettings.Font.Size:=50; testButton2.Align := alCenter; testButton2.Height := 50; testButton2.Width := 100; testButton2.Margins.Left:= 200; testButton2.Margins.top:=200; MyForm.AddNewEvent(testButton2,tbeOnClick,' '); TclForm.Create(self); testLayout := MyForm.AddNewLayout(MyForm,'testLayout'); testLayout.Align:=ALCenter; testLayout.Height := 50; SetupSqlConnection; MyForm.Run; end; 2.kısım Var MyForm:TclForm; testListview : TClListView; procedure SetupSqlConnection; begin Clomosy.DBSQLServerConnect('SQL Server','192.168.2.40','sa','kader123','stoktakibi',50000); end; procedure CreateListView; begin testListview := MyForm.AddNewListView(MyForm,'testListview'); testListview.Align := alClient; end; procedure AddDataToListview; Var foodListQuery : TClSqlQuery; begin foodListQuery := TClSqlQuery.Create(nil); try foodListQuery.Connection := Clomosy.DBSQLServerConnection; foodListQuery.SQL.Text := 'SELECT * from tblstok'; foodListQuery.Open; if foodListQuery.Found then begin testListview.clLoadListViewDataFromDataset(foodListQuery); end; finally foodListQuery.Close; foodListQuery.Free; end; end; begin MyForm := TclForm.Create(Self); CreateListView; SetupSqlConnection; AddDataToListview; MyForm.Run; end; |
|
Alforce
Yeni Üye Kayıt Tarihi: 26 Temmuz 2023 Durum: Aktif Değil Puanlar: 150 |
Mesaj Seçenekleri
Teşekkürler(0)
|
Bu hatayı niye aldığınızı bulamadım.
Ama bana ListView'i yanlış kullanıyormuşsunuz gibi geldi. Buradan detaylı bilgiye ulaşabilirsiniz.
|
|
Yanıt Yaz | |
Tweet |
Forum Atla | Forum İzinleri Kapalı Foruma Yeni Konu Gönderme Kapalı Forumdaki Konulara Cevap Yazma Kapalı Forumda Cevapları Silme Kapalı Forumdaki Cevapları Düzenleme Kapalı Forumda Anket Açma Kapalı Forumda Anketlerde Oy Kullanma |