[Lazarus] getting values from a DBGrid

Chris Jennings cjvanbc at gmail.com
Mon Dec 14 01:47:19 CET 2009


Thanks but

DBMemo3.Lines.Add(datGrid.FieldByName('crs_courseName').AsString)

returns

u_courses.pas(124,30) Error: identifier idents no member "FieldByName"

where "datGrid" is the name of my TDatasourse and "crs_courseName" is a 
column in my db

Paul Ishenin wrote:
> Chris Jennings wrote:
>> Given the following code
>>
>>     procedure TfrmCourses.DBGrid2DblClick(Sender: TObject);
>>     begin
>>        DBMemo3.Lines.Add(DBGrid2.???);
>>     end;
> DBGrid shows values from a DataSet, so use DataSet instead:
> Lines.Add(DataSet.FieldByName('MyField').AsString)
>
> Best regards,
> Paul Ishenin.
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus





More information about the Lazarus mailing list