Click here to Skip to main content
15,898,749 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi All, I am developing a module on VC++ with database linkup,my intention is i will pass the query and object to the function... there it will connect database and retrieve data and there i can find the field name and value so i need to bind to the object with the same member variable,which i am trying with RTTI but unable to get the information eg.. Quick watch in Visual studio
Posted
Updated 10-Aug-15 0:16am
v2
Comments
CPallini 10-Aug-15 6:59am    
Do you mean serialization?
https://en.wikipedia.org/wiki/Serialization
pbnarendra 10-Aug-15 8:49am    
thanks for replying....yes exactly Mr.CPallini, but how to write for c++
SundararamanS 10-Aug-15 8:05am    
can you post the code which you are trying ?
pbnarendra 10-Aug-15 9:02am    
Thank you very much... and sample code is as follows

//Create table Emp(EmpId int,Name varchar(60),Address varchar(150)) // sql table

class Emp
{
public:
int EmpId;
char Name[60],Address[150];
};

int LoadEmployee(int iEmpid, void* ptr)
{
CString strQry;
strQry.Format("Select * from Emp where EmpId=%d",iEmpid);
return GetQueryDetails(strQry,ptr)

}
int GetQueryDetails(CString strQry,void* ptr)
{
_RecordsetPtr res;
ExecuteMyQry(res,strQry); // in this the qry will execute
while(!res->GetadoEOF())
{
//iterate here and have to sync to actual object
}
return 1;
}
SundararamanS 11-Aug-15 2:15am    
Thanks, are you trying to implement an ORM layer ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900