首页 > 代码库 > 了解AdvStringGrid

了解AdvStringGrid

1.利用AdoConnect+AdoQuery链接SqlServer查询数据

int i,j,col,row;    UnicodeString strSQL;    strSQL = " select * from viewBasicLensProblem";    adoquery->Close();    adoquery->SQL->Clear();    adoquery->SQL->Add(strSQL);    adoquery->Open();    col = qryBasic->FieldCount;    row = qryBasic->RecordCount;    strGrid1->ColCount = col;    strGrid1->RowCount = row+1;    for (i =1; i < row+1; i++)    {        for ( j =0; j< col; j++)        {            strGrid1->Cells[j][i] = qryBasic->Fields->Fields[j]->AsString;        }        qryBasic->Next();    }

了解AdvStringGrid