Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ MFC ADO.NET database
I have an application that used OBDC to connect to a SQL Server database. The application is an MFC application written in Visual C++. I have been asked to investigate moving from OBDC to ADO.NET. Is there any documentation available that describes an application of this type? What types if issues might I encounter? The application is several hundreds of thousands of lines of code and I am hoping this is not too intrusive a process. Thanks.
Posted 16-Jun-10 3:22am
Edited 16-Jun-10 3:33am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Mojosound2007 wrote:

What on Earth is that?Is is ODBC?
ADO.NET is an abstraction layer which uses SQL server managed provider for loading and saving data.It's supposed to be used in managed code but MFC library is based on UNmanaged C++ not managed (C++/CLI). So you don't need to move to ADO.NET if you are targeting MFC. Smile | :)
Mojosound2007 at 16-Jun-10 9:53am
We want to move away from ODBC. The choices given to us were OLE DB and ADO.NET. OLE DB is an older technology and ADO.NET newer. That is the extent of my knowledge at this moment.
Hristo Bojilov at 16-Jun-10 10:11am
Yes ODBC is old and really difficult to use but it's efficient.If you mix managed and unmanaged code the results potentially could be awful.You need to use C++/CLI which is not stable enough, extremely sluggish and memory resource hog.Before years I've made small test program in C# and then rewrite the same code in C++/CLI.The second app was up to tree times slower and consumes 4 times more memory that C# ones.So is it worth to mix managed and unmanaged code-I say no.C++ is old language like OLE DB technology but it's still used and it will be used long time in the future.

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

  Print Answers RSS
0 OriginalGriff 254
1 Nirav Prabtani 223
2 Sergey Alexandrovich Kryukov 209
3 _Amy 165
4 Richard MacCutchan 135
0 OriginalGriff 7,799
1 Sergey Alexandrovich Kryukov 6,966
2 Maciej Los 3,994
3 Peter Leow 3,708
4 CHill60 2,742

Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 16 Jun 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100