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:
Imports System Imports System.Data Imports System.Data.OleDb Imports System.Reflection Namespace DataLayer Public Class DataObj Private _mconn As String Public Sub New() MyBase.new() _mconn = "" End Sub Public Sub New(ByVal mconn As String) MyBase.new() _mconn = mconn End Sub Public Property GetConStr() As String Get Return _mconn End Get Set(ByVal Value As String) _mconn = Value End Set End Property Public Function GetCategories() As DataView Dim connstr As System.Data.OleDb.OleDbConnection Dim adapt As System.Data.OleDb.OleDbDataAdapter Dim ds As System.Data.DataSet connstr = New System.Data.OleDb.OleDbConnection(_mconn) adapt = New System.Data.OleDb.OleDbDataAdapter("SELECT DISTINCT CategoryName FROM Category", connstr) ds = New DataSet Try adapt.Fill(ds, "Category") Return ds.Tables("Category").DefaultView Catch ex As Exception Throw ex End Try connstr.Close() End Function Public Function GetProductsForCategory(ByVal category As String) As DataView Dim connstr As System.Data.OleDb.OleDbConnection Dim adapt As System.Data.OleDb.OleDbDataAdapter Dim ds As System.Data.DataSet connstr = New OleDbConnection(_mconn) adapt = New OleDbDataAdapter("SELECT ProductName,UnitPrice,ImagePath,c.CategoryId FROM Products p,Category c WHERE c.categoryId='" & category & " ' and p.CategoryId = c.CategoryId ", connstr) ds = New DataSet Try adapt.Fill(ds, "Product") Return ds.Tables("Product").DefaultView Catch ex As Exception Throw ex End Try connstr.Close() End Function End Class End Namespace




Reply With Quote