.NETGURU
OLEDB Provider throws exception "Specified cast is not valid"
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.adonet.

Post a new message to this list...

HVG
We are trying to use a 3rd party OLEDB driver that apparently works well
under VB6.
The driver appears to be installed correctly, as we can access data via the
driver using Excell.

Just excecuting the following lines...
dim oledbCnctn as New OleDbConnection(<CnctnString>)
oldedbCnctn.Open()
throws the exception "Specified cast is not valid" (please see details
below).

All connection string parameters except the provider-name are ignored (ie.
they are correct as per the Excell test above), but altering them has no
effect on the exception thrown.
As we are aware, no one else has used this OLEDB driver within in the .NET
environment before, and we posses no experience in OLEDB driver development.
We access SQL data with no problems.

Any ideas as to what we should be doing/trying greatly appreciated.
Should an existing OLEDB driver automatically work in the .NET environment,
or could some modifications be required first?

Many thanks for any help.
Hugo

[InvalidCastException: Specified cast is not valid.]
System.Data.OleDb.OleDbException..ctor(IErrorInfo errorInfo, Int32
errorCode, Exception inner)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hResult,
OleDbConnection connection, Object src)
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()

It looks as tho the OLEDB driver is returning a result value that cannot be
cast to an integer - this maybe because the driver reports a failure or it
experenced a problem?
FYI: The 3rd-party driver provides a SQL-like interface to an ISAM-like file
system of flat files.

Reply to this message...
 
    
Val Mazur
Hi,

If you are sure that syntax for the connection string is fine, then most
likely OLEDB provider is not certified for the .NET. Not all OLEDB providers
work with .NET and even some Microsoft's OLEDB providers do not work. To be
able to work with those provider's from .NET they should meet some level of
standard. I would ask vendor of the provider if it is compatible with .NET
or not

--
Val Mazur
Microsoft MVP

"HVG" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
HVG
Thanks for the reponse.
I'm certain there has been no certification for .NET operation - the hope
was that it would work ok.
It seems geared for use with Recordset operations, which don't seem to make
much sense to me in ADO.NET.

Is there maybe some "compatability mode" that I could use this driver in
under .NET, or would the only way be to build a small ASP appln & run it on
a non-.NET server (eg. Windows 2000 without the Framework installed), and
have my ASPX appln communicate with it.

Thanks for the help.
Hugo

"Val Mazur" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Val Mazur
You cannot specify any level of compatibility. It just works or not.

--
Val Mazur
Microsoft MVP

"HVG" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
HVG
Ok, thanks.
Hugo

"Val Mazur" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Data.OleDb.OleDbConnection
System.Data.OleDb.OleDbException
System.InvalidCastException




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification