Bug: Issue with VB.NET, ASP.NET, ADO 2.6 on Win2K and IIS 5.0??

Bug: Issue with VB.NET, ASP.NET, ADO 2.6 on Win2K and IIS 5.0??

Post by Pram » Sun, 30 Jun 2002 01:39:43



I have 2 IIS Virtual Directories called MyTest1 and MyTest2. Each virtual
directory has a ASP.NET file called "test.aspx" which using ADO 2.6
(not ADO.NET) to populate its combo-box on the Page_Load event.
(see the code below)

The problem is if I execute "test.aspx" on the first virtual directory
FIRST,
http://mgmtsys16/MyTest1/Test.aspx,  then I can NOT execute "test.aspx" on
the second virtual directory, http://mgmtsys16/MyTest2/Test.aspx.

After debugging for few hours, I found out that when I call "test.aspx" on
the second
virtual directory after calling "test.aspx" on the first virtual directory
first, its recordset
does NOT have "Fields" object. However, I can still loop on its recordset.

My conclusion, we can not have 2 virtual directories on the same computer
accessing
ADO 2.6 using ASP.NET and VB.NET. But it is okay to have 2 aspx files
accessing
ADO 2.6 on the same virtual directory. Is it a bug or just setting matter?

/************* Sample Code ***************/

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here

        Dim strConnection As String = "provider=SQLOLEDB; server=mgmtsys16;
database=WITSML; uid=sa;"
        Dim dbConnection As ADODB.Connection
        Dim rstData As ADODB.Recordset
        Dim strResult As New ArrayList()
        Dim strSQL As String

        Try
            'Create DB Connection
            dbConnection = New ADODB.Connection()
            dbConnection.Open(strConnection)

            strSQL = "select groupName from tblTypes where objectType =
'objectSchema' ORDER BY groupName"
            rstData = dbConnection.Execute(strSQL)

            Do While Not rstData.EOF
                strResult.Add("" & rstData.Fields("groupName").Value)
                rstData.MoveNext()
            Loop

        Catch exc As Exception
            Throw exc

        Finally
            If Not dbConnection Is Nothing Then
                If dbConnection.State =
ADODB.ObjectSta*um.adStateConnecting Then dbConnection.Close()
                dbConnection = Nothing
            End If

        End Try

        Me.cboDataObject.DataSource = strResult
        Me.cboDataObject.DataBind()

End Sub

 
 
 

Bug: Issue with VB.NET, ASP.NET, ADO 2.6 on Win2K and IIS 5.0??

Post by Carl Perr » Sun, 30 Jun 2002 03:24:56


Pram,

    How did you reference your ADO dll?  Did you use the ADODB.dll PIA that
came with Visual Studio .NET.  Try to add the ADODB.DLL to the GAC on the
web server's machine, and add a reference to that dll, not MSADO15.dll.

Carl


Quote:> I have 2 IIS Virtual Directories called MyTest1 and MyTest2. Each virtual
> directory has a ASP.NET file called "test.aspx" which using ADO 2.6
> (not ADO.NET) to populate its combo-box on the Page_Load event.
> (see the code below)

> The problem is if I execute "test.aspx" on the first virtual directory
> FIRST,
> http://mgmtsys16/MyTest1/Test.aspx,  then I can NOT execute "test.aspx" on
> the second virtual directory, http://mgmtsys16/MyTest2/Test.aspx.

> After debugging for few hours, I found out that when I call "test.aspx" on
> the second
> virtual directory after calling "test.aspx" on the first virtual directory
> first, its recordset
> does NOT have "Fields" object. However, I can still loop on its recordset.

> My conclusion, we can not have 2 virtual directories on the same computer
> accessing
> ADO 2.6 using ASP.NET and VB.NET. But it is okay to have 2 aspx files
> accessing
> ADO 2.6 on the same virtual directory. Is it a bug or just setting matter?

> /************* Sample Code ***************/

> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>         'Put user code to initialize the page here

>         Dim strConnection As String = "provider=SQLOLEDB;
server=mgmtsys16;
> database=WITSML; uid=sa;"
>         Dim dbConnection As ADODB.Connection
>         Dim rstData As ADODB.Recordset
>         Dim strResult As New ArrayList()
>         Dim strSQL As String

>         Try
>             'Create DB Connection
>             dbConnection = New ADODB.Connection()
>             dbConnection.Open(strConnection)

>             strSQL = "select groupName from tblTypes where objectType =
> 'objectSchema' ORDER BY groupName"
>             rstData = dbConnection.Execute(strSQL)

>             Do While Not rstData.EOF
>                 strResult.Add("" & rstData.Fields("groupName").Value)
>                 rstData.MoveNext()
>             Loop

>         Catch exc As Exception
>             Throw exc

>         Finally
>             If Not dbConnection Is Nothing Then
>                 If dbConnection.State =
> ADODB.ObjectSta*um.adStateConnecting Then dbConnection.Close()
>                 dbConnection = Nothing
>             End If

>         End Try

>         Me.cboDataObject.DataSource = strResult
>         Me.cboDataObject.DataBind()

> End Sub


 
 
 

Bug: Issue with VB.NET, ASP.NET, ADO 2.6 on Win2K and IIS 5.0??

Post by Pram » Sun, 30 Jun 2002 04:11:17


Carl,
Yes, by putting into GAC, it solves my problem.
I am running this test on a "clean" machine (without VS.NET).
Why putting into GAC can solve this problem??
When do we need to use GAC??

Thanks Carl.


> Pram,

>     How did you reference your ADO dll?  Did you use the ADODB.dll PIA
that
> came with Visual Studio .NET.  Try to add the ADODB.DLL to the GAC on the
> web server's machine, and add a reference to that dll, not MSADO15.dll.

> Carl



> > I have 2 IIS Virtual Directories called MyTest1 and MyTest2. Each
virtual
> > directory has a ASP.NET file called "test.aspx" which using ADO 2.6
> > (not ADO.NET) to populate its combo-box on the Page_Load event.
> > (see the code below)

> > The problem is if I execute "test.aspx" on the first virtual directory
> > FIRST,
> > http://mgmtsys16/MyTest1/Test.aspx,  then I can NOT execute "test.aspx"
on
> > the second virtual directory, http://mgmtsys16/MyTest2/Test.aspx.

> > After debugging for few hours, I found out that when I call "test.aspx"
on
> > the second
> > virtual directory after calling "test.aspx" on the first virtual
directory
> > first, its recordset
> > does NOT have "Fields" object. However, I can still loop on its
recordset.

> > My conclusion, we can not have 2 virtual directories on the same
computer
> > accessing
> > ADO 2.6 using ASP.NET and VB.NET. But it is okay to have 2 aspx files
> > accessing
> > ADO 2.6 on the same virtual directory. Is it a bug or just setting
matter?

> > /************* Sample Code ***************/

> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >         'Put user code to initialize the page here

> >         Dim strConnection As String = "provider=SQLOLEDB;
> server=mgmtsys16;
> > database=WITSML; uid=sa;"
> >         Dim dbConnection As ADODB.Connection
> >         Dim rstData As ADODB.Recordset
> >         Dim strResult As New ArrayList()
> >         Dim strSQL As String

> >         Try
> >             'Create DB Connection
> >             dbConnection = New ADODB.Connection()
> >             dbConnection.Open(strConnection)

> >             strSQL = "select groupName from tblTypes where objectType =
> > 'objectSchema' ORDER BY groupName"
> >             rstData = dbConnection.Execute(strSQL)

> >             Do While Not rstData.EOF
> >                 strResult.Add("" & rstData.Fields("groupName").Value)
> >                 rstData.MoveNext()
> >             Loop

> >         Catch exc As Exception
> >             Throw exc

> >         Finally
> >             If Not dbConnection Is Nothing Then
> >                 If dbConnection.State =
> > ADODB.ObjectSta*um.adStateConnecting Then dbConnection.Close()
> >                 dbConnection = Nothing
> >             End If

> >         End Try

> >         Me.cboDataObject.DataSource = strResult
> >         Me.cboDataObject.DataBind()

> > End Sub

 
 
 

1. Bug: Issue with VB.NET, ASP.NET, ADO 2.6 on Win2K and IIS 5.0??

I have 2 IIS Virtual Directories called MyTest1 and MyTest2. Each virtual
directory has a ASP.NET file called "test.aspx" which using ADO 2.6
(not ADO.NET) to populate its combo-box on the Page_Load event.
(see the code below)

The problem is if I execute "test.aspx" on the first virtual directory
FIRST,
http://mgmtsys16/MyTest1/Test.aspx,  then I can NOT execute "test.aspx" on
the second virtual directory, http://mgmtsys16/MyTest2/Test.aspx.

After debugging for few hours, I found out that when I call "test.aspx" on
the second
virtual directory after calling "test.aspx" on the first virtual directory
first, its recordset
does NOT have "Fields" object. However, I can still loop on its recordset.

My conclusion, we can not have 2 virtual directories on the same computer
accessing
ADO 2.6 using ASP.NET and VB.NET. But it is okay to have 2 aspx files
accessing
ADO 2.6 on the same virtual directory. Is it a bug or just setting matter?

/************* Sample Code ***************/

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here

        Dim strConnection As String = "provider=SQLOLEDB; server=mgmtsys16;
database=WITSML; uid=sa;"
        Dim dbConnection As ADODB.Connection
        Dim rstData As ADODB.Recordset
        Dim strResult As New ArrayList()
        Dim strSQL As String

        Try
            'Create DB Connection
            dbConnection = New ADODB.Connection()
            dbConnection.Open(strConnection)

            strSQL = "select groupName from tblTypes where objectType =
'objectSchema' ORDER BY groupName"
            rstData = dbConnection.Execute(strSQL)

            Do While Not rstData.EOF
                strResult.Add("" & rstData.Fields("groupName").Value)
                rstData.MoveNext()
            Loop

        Catch exc As Exception
            Throw exc

        Finally
            If Not dbConnection Is Nothing Then
                If dbConnection.State =
ADODB.ObjectStateEnum.adStateConnecting Then dbConnection.Close()
                dbConnection = Nothing
            End If

        End Try

        Me.cboDataObject.DataSource = strResult
        Me.cboDataObject.DataBind()

End Sub

2. Q: DDE to WP

3. Porting Access VBA Code ADO 2.6 to ASP.NET w/ ADO.NET

4. NV6000

5. VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET USA/Canada

6. client/server unable to ping

7. Is this a VB.NET BUG or ASP.NET BUG???

8. Netscape Mail

9. vb.net /asp.net 2.0 duble click issue with button and provided code also