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 12: Public Sub AddCart(ByVal CustomerID As Integer, ByVal ProductID As Integer, ByVal Qty As Integer)
Line 13: 'Add a single row item to the cart
Line 14: Dim objCmd As New OleDbCommand("uspAddCart", objConn)
Line 15: objCmd.CommandType = CommandType.StoredProcedure
Line 16:
Problem is line 14, but why? Everything was working - now it isn't! What might I have done?
Connection info:
Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader
Private objConn = CType(configurationAppSettings.GetValue("DSN", GetType(System.String)), String)
...and in Web.config:
<add key="DSN" value="Provider=Microsoft.Jet.OleDB.4.0;Data Source=c:\files\access\data\ProvidenceData.mdb" />