16,472
社区成员
发帖
与我相关
我的任务
分享
void CdataDlg::OnBnClickedButton2()
{
// TODO: 在此添加控件通知处理程序代码
CString strSql = "";
strSql.Format("adf'%s'", "asd");//这段代码没错
strSql.Format("insert into TerrainTable(IndexId, PointIndex, PtX, PtY, PtZ, Layername, color) values (%d, %d, %.4f, %.4f, %.4f, '%s', %d)",
1, 1, 10.222, 1010, 1.54, "sf", 1);//这段代码却出错????????!!!!
MessageBox(strSql);
}
void CdataDlg::OnBnClickedButton2()
{
// TODO: 在此添加控件通知处理程序代码
CString strSql = "";
strSql.Format("adf'%s'", "asd");//这段代码没错
strSql.Format("insert into TerrainTable(IndexId, PointIndex, PtX, PtY, PtZ, Layername, color) values (%d, %d, %.4f, %.4f, %.4f, '%s', %d)",
1, 1, 10.222, 1010.0, 1.54, "sf", 1);//这段代码却出错????????!!!!应该是1010.0
MessageBox(strSql);
}
CString strSql = "";
strSql.Format("adf\'%s\'", "asd");//Õâ¶Î´úÂëû´í
strSql.Format("insert into TerrainTable(IndexId, PointIndex, PtX, PtY, PtZ, Layername, color)"
"values (%d, %d, %.4f, %.4f, %.4f, \'%s\', %d)",
1, 1, 10.222, (float)1010, 1.54, "sf", 1);//Õâ¶Î´úÂëÈ´³ö´í????????!!!!
AfxMessageBox(strSql);