I have this code running on my test server and the production server with
Windows 2000 working properly.
I have installed on my laptop Windows 2000 Professional, Visual Studio
..net, the components tools and Sybase 7 for my dbengine, the db is started
and personal web manager is started but when I run a page with this code, or
any other page to try to connect to the database I receive this error
message. I don't understand why is not able to connect to the database.
Please any help will be very appreciated.
Thanks.
Manolo
**********************************************
Server Error in '/testdbconnect' Application.
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 49: tempConnection.Open()
Line 50: tempCommand = New OleDbCommand(tempstrSql, tempConnection)
Line 51: tempDataReader = tempCommand.ExecuteReader()
Line 52 If tempDataReader.Read() Then
Source File: c:\inetpub\wwwroot\testdbconnect\WebForm2.aspx.vb Line: 51
Stack Trace:
[InvalidCastException: Specified cast is not valid.]
System.Data.OleDb.OleDbDataReader.NextResult()
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
System.Data.OleDb.OleDbCommand.ExecuteReader()
testdbconnect.WebForm2.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\testdbconnect\WebForm2.aspx.vb:51
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET
Version:1.0.3705.0
***************************************************************************