str.Format(_T("select FoodName,FoodPrice from [FoodManage].[dbo].[Caishiinfo]")); theApp.m_rsPtr=theApp.m_conPtr->Execute((_bstr_t(str)),NULL,adCmdText);
CString sName,sPrice;
while(!theApp.m_rsPtr->adoEOF)
{
sName=theApp.m_rsPtr->GetCollect("FoodName").bstrVal; sPrice.Format(_T("%0.2f"),theApp.m_rsPtr->GetCollect("FoodPrice").fltVal ); m_List_Caidan.AddString(sName + " " + sPrice ); theApp.m_rsPtr->MoveNext();
}数据库表如图:
CString sName,sPrice;
while(!theApp.m_rsPtr->adoEOF)
{
sName=theApp.m_rsPtr->GetCollect("FoodName").bstrVal; sPrice.Format(_T("%0.2f"),theApp.m_rsPtr->GetCollect("FoodPrice").fltVal ); m_List_Caidan.AddString(sName + " " + sPrice ); theApp.m_rsPtr->MoveNext();
}数据库表如图:
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货