Posts

Showing posts from October, 2013

Delphi stringgrid Sample (Using for loop)

Image
1.   Open new Delphi  VCL application. 2. Drag and drop  stringgrid component to the form. 3. Drag and drop  Button component to the form. 4. Copy and past below code to the button "click" property. procedure TForm1.Button1Click(Sender: TObject); var i, ix :integer; begin StringGrid1.ColCount:=10; StringGrid1.RowCount:=10; for I := 0 to 10 do for Ix := 0 to 10 do   with StringGrid1 do   begin   Cells[i,ix] := 'Col - ' + inttostr(i) + ', Row - ' + inttostr(ix);   ColWidths[i-1]:=100;   end; end; 5. Run the application.

Delphi XE4 sample (Step by Step how to download data from CSV to SQL Table)

1.  Create Table in SQL database as fallows.            CREATE TABLE SAMPLE                              ( STAFF_ID VARCHAR(30),                                DATEX VARCHAR(50),                                TIMEX VARCHAR(50),                                STATUS VARCHAR(50) ) 2. Add database to your form 3. Create connection to data base 4. Add Query ti table and rename as QR1. 5. Create Folder in C:\DataCSV. 6. Create new text file in C:\DataCSV and rename as "Data". 7. Copy below data to text file. 161|9/7/2013|16:59|0 161|9/7/2013|16:59|0 161|9/7/2013|16:59|1 161|9/7/2013|16:59|1 161|9/7/2013|17:0|1 161|9/7/2013|17:0|1 161|9/7/2013|17:0|0 161|9/7/2013|17:0|1 161|9/7/2013|17:0|0 8.  Open new delphi  VCL application. 9.  Rename the form as "frmDownload". 10.  Add new button and rename as "Download". 11.  Copy and past below code to the button as click procedure. procedure TForm1.DownloadClick(Sender: TObject); var