Home > Back-end >  Multiple custom class to the database
Multiple custom class to the database

Time:10-13

Software to do before I didn't do (), there is a field in a database (image), now I can read the image,
For example:

There are two classes:
Type
TOneGrade =the packed record//1
GradeName: string [FILENAME_LEN];
Criterion: string [255];
The end;
TGradeData=HTTP://https://bbs.csdn.net/topics/record//2
Gradecount: Integer;
Gradelist: array [1.. 128] of the TOneGrade .
The end;

Read:
SSchdata:=qry2 FieldByName (' tf_schdata). AsString;
BigSch. SchList:=TMemoryStream. Create;
BigSch. SchList. Position:=0;
BigSch. SchList. Write (sSchlist [1], the Length (sSchlist));
//- function call
BatchData. BatchSch. SchList. Position:=
Sizeof (TSchStep) * (iTray SchStep) + sizeof (integer);
BatchData. BatchSch. SchList. Read (PSch ^, sizeof (TSchStep));

This code is only a part, I just want to explain how to read, (because there are more than 30 classes, the code is too long),
Read out the east east TOneGrade are about the same as above, can be read directly,
My question is: how to save so much dongdong at once as a database, (I can read only, do not save)

CodePudding user response:

Data table after built, using ADO several related data set connection, inserted the read data to the data table,

CodePudding user response:

Read the above are just a small section of the code, a total of seven segment, each segment of the class is not the same, is not very understand, thank you

CodePudding user response:

For example:
Procedure TForm1. Btn7Click (Sender: TObject);
Var t1: TOneGrade;
T2: TSchStep;
Str1: string;
The begin
T1. GradeName:='A01';//the string
T1. Criterion:='adfadf';//the string
T2. StepType:=4;//int
T2. StepName:='DDDDD';//the string
T2. BItBe:=1000;//int
T2. Length:=100;//int
The end;

How the t1, t2 two variables together, to a SQL database fields (image)?

CodePudding user response:

Their top, not heavy not heavy
  • Related