How to get the value in a specific cell lazarus / 16-Databases ---------------------------------------------------------------------- iamsunnyjai · 2013-07-01 07:00 Quoteprocedure TForm1.Button1Click(Sender: TObject); begin   SQLQuery1.Close;     if not MySQL55Connection1.Connected then     begin       MySQL55Connection1.HostName := '127.0.0.1';       MySQL55Connection1.DatabaseName := 'test';       MySQL55Connection1.Username := 'root';       MySQL55Connection1.Password := 'root';     end;     if Edit1.Text='' then       SQLQuery1.SQL.Text := 'select * from ac'     else     begin       SQLQuery1.SQL.Text := 'select * from ac where ac = :ac';       SQLQuery1.Params.ParamByName('ac').AsString := Edit1.Text;     end;     MySQL55Connection1.Connected:= True;     SQLTransaction1.Active:= True;     SQLQuery1.Open; the result of query is put into DBGrid1 How can I put the value of (1,1) in edit2.text? Thanks! ---------------------------------------------------------------------- goodname · 2013-07-01 13:30 The data used in the DBGrid comes from the underlying dataset so read from SQLQuery1. Edit1.text:= SQLQuery1.Field[1].AsString; ---------------------------------------------------------------------- iamsunnyjai · 2013-07-02 05:45 it returns: unit1.pas(61,28) Error: identifier idents no member "Field"\ How can I solve this ??? ---------------------------------------------------------------------- taazz · 2013-07-02 06:37 You are joking right? ---------------------------------------------------------------------- iamsunnyjai · 2013-07-02 10:21 (http://s9.postimg.org/6jntdjpmz/sql1.jpg) (http://s9.postimg.org/c941xuvt7/sql2.jpg) help please!! ---------------------------------------------------------------------- BigChimp · 2013-07-02 10:30 Please post code (enclosed in code tags, see the # button above when writing posts) or complete projects (as zip files), see Project/Publish project in Lazarus. Edit: have you tried code completion? Pressing ctrl-space when starting to type an identifier like Field shows you what is available. In this case, use Fields (note the s) instead of Field. ---------------------------------------------------------------------- wp · 2013-07-02 10:37 use plural ("Fields[1]") instead of singular ("Field[1]") And you should have a look a basic database tutorials: http://wiki.lazarus.freepascal.org/Databases ---------------------------------------------------------------------- BigChimp · 2013-07-02 10:39 Quote from: wp on July 02, 2013, 12:37:37 pmuse plural ("Fields[1]") instead of singular ("Field[1]") Ehm yes, that's what I said in the post above.... ---------------------------------------------------------------------- wp · 2013-07-02 10:44 Sorry, looks like I am lost - but I don't see any code of you in this thread. I was referring to goodname's posting above. [EDIT]  Ah - now I see it. Sorry. ---------------------------------------------------------------------- BigChimp · 2013-07-02 10:46 Quote from: wp on July 02, 2013, 12:44:20 pmSorry, looks like I am lost - but I don't see any code of you in this thread. I was referring to goodname's posting above. It's here: Quote from: BigChimpIn this case, use Fields (note the s) instead of Field. Anyway, better that 2 people post and give the same solution than none