Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2009, 07:03 PM
beh.tehrani beh.tehrani is offline
Senior Member
 
Join Date: Mar 2009
Posts: 316
Default simple write in dbgrid

hello

my dbgrid it is 2 columns.

i want if click button1, my text in edit1 and edit2, entered to dbgrid(columns1 and columns2);

also if click button2, insert edit1 and edit2 text to append dbgrid.

thanks

i'm using delphi 2009
Reply With Quote
  #2  
Old 04-16-2009, 07:25 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,059
Default RE: simple write in dbgrid

[DELPHI]procedure TForm1.Button1Click(Sender: TObject);
begin
//Update current record.
ADOTable1.Edit;
ADOTable1['Name'] := Edit1.Text;
ADOTable1['Tell'] := Edit2.Text;
ADOTable1.Post; //Or UpdateBatch;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
//Insert new record.
ADOTable1.Append;
ADOTable1['Name'] := Edit1.Text;
ADOTable1['Tell'] := Edit2.Text;
ADOTable1.Post; //Or UpdateBatch;
end;[/DELPHI]

Regards,
Abdulaziz Jasser
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:15 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.