CDatabase m_database; CRecordset m_recordset; CString strSQL,PlateNo; CString conn=(L"DRIVER=SQL Server Native Client 10.0;SERVER=.\\SQLEXPRESS;Trusted_Connection=Yes;APP=Microsoft\x00ae Visual Studio\x00ae 2010;WSID=EGGEN2;DATABASE=DB01;"); m_database.Open(conn); m_recordset.m_pDatabase=&m_database; strSQL.Format(L"select * from NP where S.NO.=1"); m_recordset.Open(CRecordset::forwardOnly,strSQL); if(m_recordset.GetRecordCount()>0) { m_recordset.GetFieldValue(L"PLATE NO",PlateNo); } m_recordset.Close(); m_database.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)