With clientdataset.commandtext, namely SQL language update image, memo

Category: Delphi -> Database Author: tianshislz12345 Date: 2013-02-23 11:41:59
 
tianshislz12345
2013-02-23 11:41:59
I use the following method to update the image, say TEXT and IMAGE types are incompatible, and the following method for MEMO no problem.
Procedure TForm1.Button1Click (Sender: TObject);
var
st: TStringStream;
begin
st: = tstringstream.create ('');
Dbimage1.Picture. Bitmap.SaveToStream (st);
CLientdataset1.CommandText: = 'insert into Student Information Sheet (student number, class code, photo) values ​​('' 1'','' 610002 '',: pic) ';
CLientdataset1.Params [0]. AsBlob: = st.DataString;
CLientdataset1.Execute;
end;
lianzhongkeji
2013-02-23 11:50:07
line statement that you have a problem:
CLientdataset1.Params [0]. AsBlob: = st.DataString;
only this: CLientdataset1.FieldByName ('BLOB') . LoadFormFile (...);
fndsjaojdoo
2013-02-23 11:53:35
The field type that is image type
bjhgbb100
2013-02-23 11:58:53
You try CLientdataset1.CommandText: = 'insert into Student Information Sheet (student number, class code, photo) values ​​('+ inttostr (1) +', '+ inttostr (610002) +',: pic) ';
qw13931625704
2013-02-23 12:17:10
You try CLientdataset1.CommandText: =' insert into ; Student Information Sheet (student number, class code, photo) values ​​(1,610002,: pic) ';
jkjk_2013
2013-02-23 12:26:36
If an Oracle database, use ODAC.
telnetbbs123
2013-02-23 12:38:37
The above method for spatial query, update image, memo are correct, ask how to use clientdataset get??