PC Review


Reply
Thread Tools Rate Thread

Errors when compiling, any ideas??

 
 
brin
Guest
Posts: n/a
 
      28th Jun 2004
I have the following vb class and am trying to compile it using vbc.exe. I
receive errors stating that System.Data and System.Data.SqlClient cannot be
imported. I am fairly new to this, any help would be gratefully recieved.

Imports System
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration

Namespace DBConnect

Public Class connect

protected conn as SqlConnection

Public Sub New()
conn = New SqlConnection(
"Server=localhost;uid=name;pwd=pass;database=db" )
End Sub

protected sub openConn()
conn.open()
end sub

protected sub closeConn()
conn.close()
end sub

End Class
End Namespace

Cheers

Brin


 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      28th Jun 2004
It is likely tou don't have a reference to the System.Data.dll. See the /r
option.

Patrice

--

"brin" <(E-Mail Removed)> a écrit dans le message de
newsdUDc.1166$(E-Mail Removed)...
> I have the following vb class and am trying to compile it using vbc.exe. I
> receive errors stating that System.Data and System.Data.SqlClient cannot

be
> imported. I am fairly new to this, any help would be gratefully recieved.
>
> Imports System
> Imports System.Data.SqlClient
> Imports System.Data
> Imports System.Configuration
>
> Namespace DBConnect
>
> Public Class connect
>
> protected conn as SqlConnection
>
> Public Sub New()
> conn = New SqlConnection(
> "Server=localhost;uid=name;pwd=pass;database=db" )
> End Sub
>
> protected sub openConn()
> conn.open()
> end sub
>
> protected sub closeConn()
> conn.close()
> end sub
>
> End Class
> End Namespace
>
> Cheers
>
> Brin
>
>



 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      28th Jun 2004

"brin" <(E-Mail Removed)> wrote in message newsdUDc.1166$(E-Mail Removed)...
> I have the following vb class and am trying to compile it using vbc.exe. I
> receive errors stating that System.Data and System.Data.SqlClient cannot be
> imported. I am fairly new to this, any help would be gratefully recieved.
>
> Imports System
> Imports System.Data.SqlClient
> Imports System.Data
> Imports System.Configuration
>


You not only need an "Imports" statement ("using" in C#),
you also need to add a reference to System.Data to your project.

(to be a bit more precise: you don't really *need* that "Imports",
you can also type the complete namespace-path, but even then
you *need* to add the reference)

Hans Kesting


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seagate drive check utility reports "errors in metadatea file records, other errors critical errors in metadata.." LQQK@mi.sig Storage Devices 0 3rd Feb 2006 05:48 AM
Errors, errors, errors Mark Goldin Microsoft ASP .NET 2 17th Jan 2004 09:05 PM
Errors, Errors, Errors John Microsoft Access 0 5th Aug 2003 09:06 PM
IE6 will not open, errors - errors - errors JMD Windows XP Internet Explorer 1 30th Jul 2003 02:15 AM
Errors, Errors, and more Errors BeckyLousiana Windows XP Performance 2 16th Jul 2003 01:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:41 PM.