staceemvnorton
New Member
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: 'ADOConnection'<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 <<<<<<<<BR>Line 11: objConn = New ADOConnection(strConnString)<BR>Line 12: objConn.Open()"<BR><BR>Here's the actual code from my page:<BR><BR><%@ Import Namespace="System.Data" %><BR><%@ Import Namespace="System.Data.ADO" %><BR><BR><script language="vb" runat="server"><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></script><BR><BR>Any ideas?<BR><BR>Nick<BR>Isn'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.