Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Won't let me ref. System.Data.Odbc

Status
Not open for further replies.

RhythmAddict112

Programmer
Jun 17, 2004
625
US
Hey All,
Im trying to connect to Teradata DB using VB.net...I Didn't get all too far! I tried to type

[vbcode]
Imports System.Data.Odbc
....
Dim oODBCConnection As OdbcConnection
[/vbcode]


All the underlined code is underlined with those lovely blue lines in VS.net meaning my code is invalid. The reference to System.Data has been made within the project...Where am I going wrong here?

My apologies if I am missing something obvious, as I am a beginner to .NET.

Thank you for your help...


Use your resources, you're on the internet!
 
And what is the error message that those blue lines are saying (hover your mouse over them...)?

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Sorry, I should have specified...

For the Imports System.Data.Odbc line:
"Namespace or type 'odbc' for the imports system.data.odbc cannot be found"

And for Dim oODBCConnection As OdbcConnection:
It just says "Type 'OdbcConnection is not defined"

Use your resources, you're on the internet!
 
Not sure if this will help, but I can import
Imports System.Data.OleDb

..with no problem

Use your resources, you're on the internet!
 
What version of the .NET Framework do you have? I have seen issues in the past with version 1.0 where it wouldn't allow users to reference the system.data.odbc but it would let them reference Microsoft.Data.ODBC which is now obsolete.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
1.0 :)

Installing 1.1 as we speak, thank you for your help!

Use your resources, you're on the internet!
 
No probs - think the upgrade should solve the problem but please post back if not.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Hi,

I think I got similar issue and here is what I did.
Instead of using: Imports System.Data.OleDb

Use this at the top of your aspx page
<%@ Import Namespace="System.Data.OleDb" %>

You can give this a try see if this will work.
 
Kendal,

The differences between using the two lines of code are that one is used for code behind pages (Imports System.Data.OleDb) and the other is used for inline coding (<%@ Import Namespace="System.Data.OleDb" %>).

If you try to use one out of context then it will fail.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top