[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Type 'OdbcConnection' not defined

Marni Alvarez

4/23/2002 5:56:00 AM

Can anyone help? I installed ODBC.NET Provider but it
seems the namespace Microsoft.Data.Odbc has not been
registered properly. I am getting this error:
error BC30002: Type 'OdbcConnection' is not defined.

Here is my code below. Any ideas?

<%@ Import Namespace="Microsoft.Data.Odbc" %>

<script language="VB" runat="server">
Public Sub Page_Load(Sender As Object, E As EventArgs)
Dim conn As New OdbcConnection("DRIVER{MySQL};SERVER=localhost;DATABASE=test;UID=marni")
Dim cmd As OdbcCommand
conn.Open()
cmd = New OdbcCommand("select * from mytable", conn)
...

Thanks in advance,
Marni
3 Answers

(Hussein Abuthuraya(MSFT))

4/23/2002 7:51:00 PM

0

Marni Alvarez

4/23/2002 9:57:00 PM

0

Thank yuo so much Hussein! It worked!

Marni

>-----Original Message-----
>Mami,
>
>Using the .NET ODBC Data provider in ASP.NET page with
inline code is different than using the same in code-
behind. The following code should work:
>
><%@ CompilerOptions='/R:"C:\Program
Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"' %>
><%@ Import Namespace = "Microsoft.Data.Odbc" %>
>
> ....
>
>
>Thanks,
>Hussein Abuthuraya
>Microsoft Developer Support
>
>This posting is provided "AS IS" with no warranties, and
confers no rights. You assume all risk for your use. ©
2002 Microsoft Corporation. All rights reserved
>
>Are you secure? For information about the Microsoft
Strategic Technology Protection Program and to order your
FREE Security Tool Kit, please visit
>http://www.microsoft.co....
>

Jonas

4/25/2002 1:19:00 PM

0

What happens when I deploy my project and
microsoft.data.odbc.dll is in a diffrent dir on the target
machine?

Is it a bug in ASP.net that you have to hardcode the path
to the dll?


>-----Original Message-----
>Mami,
>
>Using the .NET ODBC Data provider in ASP.NET page with
inline code is different than using the same in code-
behind. The following code should work:
>
><%@ CompilerOptions='/R:"C:\Program
Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"' %>
><%@ Import Namespace = "Microsoft.Data.Odbc" %>
>
> ....
>
>
>Thanks,
>Hussein Abuthuraya
>Microsoft Developer Support
>
>This posting is provided "AS IS" with no warranties, and
confers no rights. You assume all risk for your use. ©
2002 Microsoft Corporation. All rights reserved
>
>Are you secure? For information about the Microsoft
Strategic Technology Protection Program and to order your
FREE Security Tool Kit, please visit
>http://www.microsoft.co....
>