Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: DataSet problem on Dlls in Beta2


Message #1 by "Betti Alessandro\(TXT\)" <betti@g...> on Wed, 12 Sep 2001 17:01:16 +0200
In beta2 i use System.Data.OleDb for connect my DB to my application 

.All works well when i use OleDb in ASP.Net for example this code work 

fine :

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

       dim con as New OleDbConnection 

       dim com as OleDbDataAdapter

       dim strConnect as string

       dim strCommand as string

       dim dsl as new DataSet()

      

       strConnect 

"Provider=SQLOLEDB;server=testserver;uid=sa;pwd=;database=tetrapak"

       strCommand = "Select * from Users"

       Com = New OleDbDataAdapter(strCommand, strConnect)

       Com.Fill(dsl, "Users")

       MyDataGrid.DataSource=dsl.Tables("Users").DefaultView

       MyDataGrid.DataBind()

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



BUT when i put this code in a .Dll file for example:



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

Imports System

Imports System.Data

Imports System.Data.OleDb

Imports Microsoft.VisualBasic



Namespace user

Public Class USERClass



Public Function GetUserByID(userid as string) as DataView



       dim con as New OleDbConnection 

       dim com as OleDbDataAdapter

       dim strConnect as string

       dim strCommand as string

       Dim dsl As DataSet = New DataSet



      

       strConnect = 

"Provider=SQLOLEDB;server=testserver;uid=sa;pwd=;database=tetrapak"

       strCommand = "Select * from Users where UserID="+userid

       Com = New OleDbDataAdapter(strCommand, strConnect)

       Com.Fill(dsl, "Users")

       GetUserByID=dsl.Tables("Users").DefaultView          

      End Function



End Class

End Namespace

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

And i compile with VBC.exe the response is



I:\ASP_PIU\ASP_PIU_Local\bin\DB_USER\user.vb(19) : error BC30009: Unable 

to find a reference to asse

mbly 'System.Xml' containing the implemented interface 

'System.Xml.Serialization.IXmlSerializable'.

Add one to your project.



       Dim dsl As DataSet = New DataSet

                  ~~~~~~~



Someone Know why?



Thanks to All

  Return to Index