Results 1 to 2 of 2

Thread: error: imports system.data cannot b found..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    134

    error: imports system.data cannot b found..

    hi i am using vb.net
    i am trying to create a dll from a class.vb. when i am trying to create the dll from the vs.net command prompt i get this error messages:

    error: namespace or type OleDb for imports system.data cannot be found:

    can someone please help.. thanks

    my code is as follows

    VB Code:
    1. Imports System
    2. Imports System.Data
    3. Imports System.Data.OleDb
    4. Imports System.Reflection
    5. Namespace DataLayer
    6.     Public Class DataObj
    7.         Private _mconn As String
    8.  
    9.         Public Sub New()
    10.             MyBase.new()
    11.             _mconn = ""
    12.         End Sub
    13.  
    14.         Public Sub New(ByVal mconn As String)
    15.             MyBase.new()
    16.             _mconn = mconn
    17.         End Sub
    18.  
    19.  
    20.         Public Property GetConStr() As String
    21.             Get
    22.                 Return _mconn
    23.             End Get
    24.             Set(ByVal Value As String)
    25.                 _mconn = Value
    26.             End Set
    27.         End Property
    28.  
    29.         Public Function GetCategories() As DataView
    30.             Dim connstr As System.Data.OleDb.OleDbConnection
    31.             Dim adapt As System.Data.OleDb.OleDbDataAdapter
    32.             Dim ds As System.Data.DataSet
    33.  
    34.             connstr = New System.Data.OleDb.OleDbConnection(_mconn)
    35.             adapt = New System.Data.OleDb.OleDbDataAdapter("SELECT DISTINCT CategoryName FROM Category", connstr)
    36.             ds = New DataSet
    37.             Try
    38.                 adapt.Fill(ds, "Category")
    39.                 Return ds.Tables("Category").DefaultView
    40.             Catch ex As Exception
    41.                 Throw ex
    42.             End Try
    43.             connstr.Close()
    44.         End Function
    45.  
    46.         Public Function GetProductsForCategory(ByVal category As String) As DataView
    47.             Dim connstr As System.Data.OleDb.OleDbConnection
    48.             Dim adapt As System.Data.OleDb.OleDbDataAdapter
    49.             Dim ds As System.Data.DataSet
    50.  
    51.             connstr = New OleDbConnection(_mconn)
    52.             adapt = New OleDbDataAdapter("SELECT ProductName,UnitPrice,ImagePath,c.CategoryId FROM Products p,Category c WHERE c.categoryId='" & category & " ' and p.CategoryId = c.CategoryId ", connstr)
    53.             ds = New DataSet
    54.  
    55.             Try
    56.                 adapt.Fill(ds, "Product")
    57.                 Return ds.Tables("Product").DefaultView
    58.             Catch ex As Exception
    59.                 Throw ex
    60.             End Try
    61.  
    62.             connstr.Close()
    63.         End Function
    64.     End Class
    65.  
    66. End Namespace

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    134

    Re: error: imports system.data cannot b found.. [RESOLVED]

    just a short note that i resolved the problem the syntax in my command prompt for the vsc.exe.
    I had to add the references which i have added to my project with the output of my dll..


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width