I am looking for a free cross-platform (Windows, Linux) C++ library for an access to an MS SQL server DB.
For example, I want to convert the following C# flow to unmanaged C or C++ (from here) :
static void Main()
{
string connectionString =
ConsoleApplication746.Properties.Settings.Default.ConnectionString;
using (SqlConnection con = new SqlConnection(connectionString))
{
con.Open();
using (SqlCommand command =
new SqlCommand("SELECT TOP 2 * FROM Dogs1", con))
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine("{0} {1} {2}", reader.GetInt32(0),
reader.GetString(1), reader.GetString(2));
}
}
}
}