BCB中clientdataset中创建表如何添加多行数据
ClientDataSet1->FieldDefs->Clear();
ClientDataSet1->FieldDefs->Add("JGBM",ftString,10,false);
ClientDataSet1->FieldDefs->Add("KGBH",ftString,10,false);
ClientDataSet1->FieldDefs->Add("PDBH",ftString,10,false);
ClientDataSet1->FieldDefs->Add("XLPDBH",ftString,10,false);
ClientDataSet1->FieldDefs->Add("YXZT",ftString,10,false);
ClientDataSet1->Close() ;
ClientDataSet1->CreateDataSet();
ClientDataSet1->Edit();
ClientDataSet1->FieldByName("JGBM")->AsString = "1" ;
ClientDataSet1->FieldByName("KGBH")->AsString = "2";
ClientDataSet1->FieldByName("PDBH")->AsString = "3";
ClientDataSet1->FieldByName("XLPDBH")->AsString = "4";
ClientDataSet1->FieldByName("YXZT")->AsString = "5";
ClientDataSet1
ClientDataSet1->FieldByName("JGBM")->AsString = "2" ;
ClientDataSet1->FieldByName("KGBH")->AsString = "3";
ClientDataSet1->FieldByName("PDBH")->AsString = "4";
ClientDataSet1->FieldByName("XLPDBH")->AsString = "5";
ClientDataSet1->FieldByName("YXZT")->AsString = "6";
我这样好像只能填入一行数据,怎么才能填入多行数据呢
[解决办法]
Append或Insert多次就是多行数据咯。
[解决办法]
哈哈,疏忽了一下