Thanks for the reply. I can read from the List control. My doubt is, how do I insert that data into a CRecordset???
The only way I have used a CRecordset is like below:
CRecordset rs(&M_Database);
M_Recordset.Open( CRecordset::forwardOnly, strSQL);
while( !M_Recordset.IsEOF() )
{
M_Recordset.GetFieldValue( (short)0, result );
M_Recordset.MoveNext();
}
Now, when I am reading from the list control, I do not have a M_Database thing with me. Its just a CRecordset and a List control.
Nor do I have a SQL query.
I can read data from the list control with something like this:
int row = listCtrlUser.GetSelectionMark();
if(row < 0)
{
return;
}
M_cSelectedUser = listCtrlUser.GetItemText(row, 0);
or even loop over all the items of the list control and read the data.
What do I do next though?
How do I create a new CRecordset here and insert the M_cSelectedUser (in case of reading the selected line) OR M_cAllUsers (in case i am reading the whole list)
INTO THE CRECORDSET???