ADOConnection Error

Results 1 to 2 of 2

Thread: ADOConnection Error

  1. #1
    Join Date
    Dec 1969

    Default ADOConnection Error

    I get the following error when trying to connect to a database:<BR><BR>"Compilation Error <BR>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. <BR><BR>Compiler Error Message: BC30002: Type is not defined: &#039;ADOConnection&#039;<BR><BR>Source Error:<BR><BR> <BR><BR>Line 8: strConnString="Data Source=DEV;DATABASE=EOLDEV;uid=eoldev;pwd=eoldev"< BR>Line 9: <BR>Line 10: Dim objConn as ADOConnection &#060;&#060;&#060;&#060;&#060;&#060;&#060;<BR>L ine 11: objConn = New ADOConnection(strConnString)<BR>Line 12: objConn.Open()"<BR><BR>Here&#039;s the actual code from my page:<BR><BR>&#060;%@ Import Namespace="System.Data" %&#062;<BR>&#060;%@ Import Namespace="System.Data.ADO" %&#062;<BR><BR>&#060;script language="vb" runat="server"&#062;<BR><BR> Sub Page_Load(Source as Object, E as EventArgs)<BR> Dim strConnString as String<BR> strConnString="Data Source=DEV;DATABASE=EOLDEV;uid=eoldev;pwd=eoldev"< BR><BR> Dim objConn as ADOConnection<BR> objConn = New ADOConnection(strConnString)<BR> objConn.Open()<BR><BR> Dim strSQL as String = "SELECT * FROM Courses"<BR><BR> Dim objDSCommand as ADODatasetCommand<BR> Dim objDataset as Dataset<BR><BR> objDSCommand = New ADODatasetCommand(strSQL, objConn)<BR><BR> objConn.Close()<BR> objConn = Nothing <BR><BR> objDataset = New Dataset<BR> objDSCommand.FillDataSet(objDataset, "Type")<BR><BR> MyFirstDataGrid.DataSource = _<BR> objDataset.Tables("Type").DefaultView<BR> MyFirstDataGrid.DataBind()<BR><BR> End Sub<BR>&#060;/script&#062;<BR><BR>Any ideas?<BR><BR>Nick<BR>

  2. #2
    Join Date
    Dec 1969

    Default beta1 code?

    Isn&#039;t the above the Beta1 code? In Beta2, the namespace is System.Data.OleDb (not .ADO) and the connection object is:<BR><BR>Dim objConn as OleDbConnection<BR><BR><BR>See ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDataOleDb.htm for more information about the System.Data.OleDb namespace and its classes.

Posting Permissions

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