Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hello Again,
I hab used sql api for c++ for the ist time and i could successfully connect the console with the database but i couldnot export console data to sqlsever database,
lemme gib u example of my program: my program generates different names and phone numbers in two different list and i hab to select one name and one number at time and send to database.can anyone help me with the code or any good suggestions,or any links that could help me?


/thanks
In advance
adios.
Posted

Have a look on Data Access (C++)[^], MSDN article, and get more information here[^]
 
Share this answer
 
Comments
meshinator 3-Aug-12 8:11am    
Thanks for your links,but sir,im using SQLAPI for c++ for console application and i think it is pretty different in SQLAPI other than ADO and ODBC and in console part,i did tried with codes and queries,queries are allight,but i dont know wat is wrong with the codes and,from you links i could not get any idea,can you help me with some code.
Prasad_Kulkarni 3-Aug-12 8:13am    
Yes. Sure, if you post your code snippets.
meshinator 6-Aug-12 2:09am    
Hey Prasad,how u doin,Cant Put All the Code due to confidentiality issue But I'll Put Down Code Snippet,that will make easy for Your Understanding:

std::wcout<<_T("Enter the User:")<<std::endl;
char * TestUser;
TestUser = (char*)malloc(50 * sizeof(char));

scanf_s("%s",User);

wofstream myfile;
myfile.open ("C:\\Program Files\\ABC\\abc.txt",std::ios::app);
myfile<<TestUser;

myfile.close();

delete TestUser;




return res;

}
// and in this condition , my concern is to export the Username Inserted by the user to the database,lets say; dbname:abc,login:abcd,password:abcde
and reminder again that i am using SQLAPI for the connection not ODBC or ADO.

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