try { if(m_bIsDbConnected) { m_Rs=CADORecordset(&m_Db ); m_Edit_Id.GetWindowTextA(strID); m_Edit_Name.GetWindowTextA(strName); m_Edit_Age.GetWindowTextA(strAge); //m_Edit_Doj.GetWindowTextA(strDoj); m_Edit_Sal.GetWindowTextA(strsal); UINT nCheck=m_checkBoxM.GetState(); if (nCheck==BST_CHECKED) { strGender="Male"; } UINT nCheck1=m_checkBoxFm.GetState(); if (nCheck1==BST_CHECKED) { strGender="FeMale"; } strSql.Format("INSERT INTO Customers values(%d,'%s',%d, '%s', '%s', '%s','%s')", strID, (strName), strAge,strDoj, strsal,strGender); m_Rs.Open(strSql); } } catch(CADOException &ae) { AfxMessageBox(ae.GetErrorMessage()); } // Cadd->MessageBox("inserted sucessfully"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)