> I am need to access an ODBC data source from within my ASP.Net 2.0 (c#)
> application. I am Using Visual Studio 2005 Professional.
Firstly, are you absolutely sure that you need to use ODBC, and that the
RDBMS in question does not have an OleDb provider or even a native .NET data
provider...?
> I assume that I can't add them to my form because I am missing a reference
> to a DLL or something - but which one?
In .NET 2, Odbc is supported through the System.Data.Odbc namespace, so just
make sure you have:
using System.Data.Odbc;
in your code headers...
> I have found some references to Microsoft.Data.Odbc.dll but this would
> appear to be a VS2003 file, as I don't seem to have it.
In earlier versions of the .NET Framework, ODBC support was available only
as in installable add-in...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Paul Cheetham - 09 Sep 2007 09:19 GMT
> Firstly, are you absolutely sure that you need to use ODBC, and that the
> RDBMS in question does not have an OleDb provider or even a native .NET
> data provider...?
Yes. I wouldn't use it out of choice, but I am deploying the website to
a server of a commercial hosting company, and the only database access I
have, without paying huge amounts for an SQL database, is an ODBC System
DSN connection.
> In .NET 2, Odbc is supported through the System.Data.Odbc namespace, so
> just make sure you have:
>
> using System.Data.Odbc;
I have included that namespace, but the ODBC controls will not show in
the toolbox.
Thankyou.
Paul
Mark Rae [MVP] - 09 Sep 2007 09:34 GMT
> Yes. I wouldn't use it out of choice, but I am deploying the website to a
> server of a commercial hosting company, and the only database access I
> have, without paying huge amounts for an SQL database, is an ODBC System
> DSN connection.
Ouch! Sounds like it's time to find a decent ISP...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Try using the SqlNCli provider, which as I recall can handle a lot of OleDb
and ODBC "Stuff" in .NET 2.0
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
> Hi,
>
[quoted text clipped - 16 lines]
>
> Paul