Saving to a Database using C++ - c++

I am developing a C++ application and I have a problem when it comes to save ta a database.
I am using Visual Studio 2010 and the database that I am using is the Microsoft SQL Server Database.
Can please someone help to achieve this task since I am a beginner in C++?

If you're working with MS tools, you want to use the SQL Server Native client

Related

Visual studio: No sql server compact option in data connections

It is really unbelievable that I am not able to find such a simple thing, I have searched everywhere.
Actually I want to open sdf file which is a part of my project. I found that it can be opened with sql server management studio, external tools etc. but I want to open it in Visual studio by adding a simple data connection.
Am I asking too much? But Man! I am not able to find this simple thing on internet.
I my add connection window I don't see option for sql server compact data connection.
I already installed compact edition and when I am trying to install it again it is saying that it is already installed.
But for some reason visual studio is not showing up in the list of Data Sources Types.
I found this question, he is facing the same issue and his issue was also not resolved even after applying what was told in the answer
Adding SQL Server Compact Edition data source to Visual Studio?
Could somebody help to get this simple thing working?
Install the SQL Server Compact Toolbox, it will also install a DDEX provider, that allows you to connect in Server Explorer (for 4.0 only, however)

Visual studio 2010 and Mysql server

I am trying to connect VS2010 and mySQL server to write simple console application.
For 3 days i am trying to set everything up,but no luck.
I have some skills in c++ OOP,but never done anything like this.
So can someone point mi to tutorial or help here ,how to install and prepare all this thing before i could write any code.
i am using:
mysql server 5.6 and
mysql connector c++
Main problem is mysql connector/c++ i followed documentation on their site but it is too hard for me.(what are boosts,Cmake).
I guess you need .NET connector.
http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/7bd1889e-f169-4c14-9a55-7043a5dd8881
http://www.c-sharpcorner.com/UploadFile/65fc13/working-with-mysql-to-visual-studio-2010/

What is a good api to sql from visual c++

I want to do simple stuff like adding entries and reading entries by index. What libraries are there and which ones are the best?
SQLite would be a good simple SQL database engine, with a simple embedded C++ interface.
SQLAPI++ would be a good choice for many commercial SQL databases (Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase, MySQL, PostgreSQL, SQLite and ODBC)
One option is to use Microsoft's SQL Server Compact Edition. It is free, and has Visual Studio integration.
You can download it and find out more at the following link:
SQL Server Compact Edition
If you not worried about HUGE concurrency then use SQLite (www.sqlite.org). Download the aggregated version and you only have 2 files: sqlite3.h and sqlite3.c. It's REALLY easy to use and requires no server set up or configuration.

Connecting to oracle database using C++, the basics

i have a question about the theory here, i'm just starting a project which is based on C++ applications integrating with oracle DB's, i've came to two choices, OCCI, and OCI
the OCCI is said to be aimed at C++ environment, but i was wondering, if it would be any good to use the OCI libraries from my C++ app since it is said to have better performance, or would i run into compatibility issues ?
thanks in advance :)
You can have a look at OTL it's a wrapper above the OCI or OCCI (not sure) will give some templates and samples to start with oracle connection in c++.
In my case, my company have about a thousand stores.
To connect Oracle / Oracle thru an MS C++ multi-thread service we perform the following tests on each thread:
Validate DNS (gethostbyname)
Try to open SCManager of the store (OpenSCManager)
Verify if Oracle Service exists on the store (OpenService)
Verify if Oracle Service is running (QueryServiceStatus)
After all, we try to connect (ado->Open)
This procedures minimize possible errors like 0xE06D7363 when connecting to a external server.

Connecting and Fetching a record form sequel server 2005

I have a windows application in visual C++. I am not using MFC, in this application I have connect to SQL server 2005 and fetch records form a database file. Can any one guide me how this can done. Thanks in advance.
I would say, you could use some wrapper framework around the odbc calls. Currently I was working on a project where SQL server communication was involved so I found this wrapper framework: TinyODBC which is a minimalistic ODBC wrapper library. It's pretty trivial how can one use it, but I have to admit I had to patch it for a little more functionality. But otherwise it is a useful choice of ODBC communication. Now, you can use the native SQL driver via ODBC. Since it's a minimal framework, if you go through the tutorial you'll be ready to create new application with it.
Now
The complete list of accessing methods is listed here. Most popular choices for C++ programmers are SQL Server Native Client and MDAC/Windows DAC, both support OLEDB and ODBC interfaces. A comparison of SQL Server Native Client and MDAC/WIndows DAC is here.
There are other wrappers built on top of OLEDB and ODBC such as ADO or TynyODBC, which can help you to write more readable code.