A Doubt
-
can anyone helpme how to pass query values dynamically. (e.g) cin>>a; cin>>b; char szStr1[100]="Insert into region(regionId,RegionDescription)Values(????,????)" In what format I should supply the values (i.e) the values of a,b.(plz rewrite the above statement)
-
can anyone helpme how to pass query values dynamically. (e.g) cin>>a; cin>>b; char szStr1[100]="Insert into region(regionId,RegionDescription)Values(????,????)" In what format I should supply the values (i.e) the values of a,b.(plz rewrite the above statement)
you can put construct the query this way..
cin>>a; cin>>b; char szStr1[100]; sprintf(szStr1,"Insert into region(regionId,RegionDescription)Values(%d,%d)",a,b);
My God is more powerfull Than Your God. (the line that divides the world) -
can anyone helpme how to pass query values dynamically. (e.g) cin>>a; cin>>b; char szStr1[100]="Insert into region(regionId,RegionDescription)Values(????,????)" In what format I should supply the values (i.e) the values of a,b.(plz rewrite the above statement)
#include <sstream>
int a,b; // assume initialized from cin
std::ostringstream strm;
std::string s;strm << "Insert into region(regionID, RegionDescription)Values(" << a
<< "," << b << ")" << std::ends;
s = strm.str();--Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- Buffy