Sayfayı Yazdır | Pencereyi Kapat

SQL

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=1132
Tarih: 26 Temmuz 2025 Saat 13:45
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: SQL
Mesajı Yazan: enescrrhgl
Konu: SQL
Mesaj Tarihi: 24 Temmuz 2025 Saat 16:22
sql kodlarını yazdım da syntax error diyor.

var
  anaForm: TclForm;
  bottomPanel: TclProPanel;
  newScreenButton: TclProButton;

  productCodePanel: TclProPanel;
  productNamePanel: TclProPanel;
  stockTypePanel: TclProPanel;

  productCodeLabel: TclProLabel;
  productCodeEdit: TclProEdit;

  productNameLabel: TclProLabel;
  productNameEdit: TclProEdit;

  stockTypeLabel: TclProLabel;
  stockTypeCombo: TCLComboBox;
  
  insertQuery: TclSqlQuery;


 void InstertToDatabase;
{
  try
  
    Clomosy.DBSQLServerQuery.Sql.Text = 'INSERT  INTO Urunler (ProductCode, ProductName, StockType) VALUES ( '+productCodeEdit.Text+','+productNameEdit.Text+', '+stockTypeCombo.Value+' )';
    Clomosy.DBSQLServerQuery.ExecSql;
    ShowMessage('VERİ EKLEME BASARILI');
    
    except
      
      ShowMessage('Exception class: ' +LastExceptionClassName+ 'Exception message: ' +LastExceptionMessage);
    
}

insertQuery = TclSqlQuery.Create(nil);
  Clomosy.DBSQLServerConnect('SQL Server', 'DESKTOP-4JVIBLD\SQLEXPRESS', 'sa', '123456', 'clomosyDB',1433);
  insertQuery.Connection = Clomosy.DBSQLServerConnection;




Cevaplar:
Mesajı Yazan: Mahmutdmr
Mesaj Tarihi: 24 Temmuz 2025 Saat 17:07
Merhaba Enes,

except'in sonuna "}" koyarsan sorunun ortadan kalcağını düşünüyorum umarım yardımcı olabilmişimdir. iyi çalışmalar.

except
      
      ShowMessage('Exception class: ' +LastExceptionClassName+ 'Exception message: ' +LastExceptionMessage);
    }
}



Mesajı Yazan: enescrrhgl
Mesaj Tarihi: 24 Temmuz 2025 Saat 17:10
teşekkür ederim dediğini yaptım olduSmile



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