Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

ODBC Datasource problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Cheetham - 08 Sep 2007 11:38 GMT
Hi,

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.

I have added the ODBC objects to the toolbox, as they are not in it by
default, but they still won't show.
If I 'view all' on the toolbox they are there, but disabled.

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?

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.

Can anybody tell me how I can get this to work?

Thankyou.

Paul
Mark Rae [MVP] - 08 Sep 2007 13:03 GMT
> 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

Peter Bromberg [C# MVP] - 09 Sep 2007 01:00 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.