CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.microsoft_application_blocks Tags:
Item Type: NewsGroup Date Entered: 6/24/2005 6:51:01 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 89 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
ech01
Asp.Net User
Enterprise Library: Object must implement IConvertible6/24/2005 6:51:01 PM

1

I am trying to use th EntLib DAAB to execute a sp that inserts some values and reutrns two output parameters (returned as an array) . I pretty much modified the function in the documentation to fit my need, but I get the Object must implement IConvertible. This is getting pretty frustrating because according to the example it should work. Any and all help is appreciated.


Object must implement IConvertible.

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: Object must implement IConvertible.

Source Error:

Line 28:             dbCommandWrapper.AddOutParameter("@supplement_no", DbType.Int16, 4)
Line 29: 
Line 30:             db.ExecuteNonQuery(dbCommandWrapper)
Line 31: 
Line 32:             ' Row of data is captured via output parameters

Source File: c:\inetpub\wwwroot\CaseMgmt\Classes\DataAccess.vb    Line: 30

sdsd

Stack Trace:

[InvalidCastException: Object must implement IConvertible.]
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DBCommandWrapper command)
   Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DBCommandWrapper command)
   CaseMgmt.CaseMgmt.DataAccess.NewSLCaseInsert(Int32& CaseType, Int32& SubCaseType, String& UserName, Int32& CompanyCode, Int32& Loc) in c:\inetpub\wwwroot\CaseMgmt\Classes\DataAccess.vb:30
   CaseMgmt.CaseMgmt.SLQuickStart.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\CaseMgmt\SLQuickStart.aspx.vb:54
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()


And here is the function being executed:

<code>
Public
Function NewSLCaseInsert(ByRef CaseType As Integer, ByRef SubCaseType As Integer, ByRef UserName As String, ByRef CompanyCode As Integer, ByRef Loc As Integer) As ArrayList

Dim DateNow As DateTime = DateNow.Now

Dim TimeNow As TimeSpan = DateNow.TimeOfDay

' Create the Database object, using the default database service. The

' default database service is determined through configuration.

Dim db As Database = DatabaseFactory.CreateDatabase()

'Dim sqlCommand As String = "LP_CASE_NEW_CASE"

Dim dbCommandWrapper As DBCommandWrapper = db.GetStoredProcCommandWrapper("LP_CASE_NEW_CASE")

' Add paramters

' Input parameters can specify the input value

dbCommandWrapper.Command.CommandType = CommandType.StoredProcedure

dbCommandWrapper.AddInParameter("@user", DbType.String, UserName)

dbCommandWrapper.AddInParameter("@co", DbType.Int16, CompanyCode)

dbCommandWrapper.AddInParameter("@loc", DbType.Int16, Loc)

dbCommandWrapper.AddInParameter("@date", DbType.Date, DateNow.Date)

dbCommandWrapper.AddInParameter("@time", DbType.Time, DateNow.TimeOfDay)

dbCommandWrapper.AddInParameter("@case_type_cd", DbType.Int16, CaseType)

dbCommandWrapper.AddInParameter("@sub_case_type_cd", DbType.Int16, SubCaseType)

' Output parameters specify the size of the return data

dbCommandWrapper.AddOutParameter("@CASE_ID", DbType.Int16, 4)

dbCommandWrapper.AddOutParameter("@supplement_no", DbType.Int16, 4)

db.ExecuteNonQuery(dbCommandWrapper)

' Row of data is captured via output parameters

Dim CaseId As Integer = dbCommandWrapper.GetParameterValue("@CASE_ID")

Dim SupplNum As Integer = dbCommandWrapper.GetParameterValue("@supplement_no")

Dim arrReturn As ArrayList

arrReturn.Add(CaseId)

arrReturn.Add(SupplNum)

Return arrReturn

End Function</code>

ech01
Asp.Net User
Re: Enterprise Library: Object must implement IConvertible6/27/2005 5:24:06 PM

0

Problem resolved. It was due to the TimeofDay parameter.
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Microsoft Enterprise Library Data Access Application Blocks ... Microsoft Enterprise Library Data Access Application Blocks Execute Reader ( Object must implement IConvertible). Last Updated Wednesday, January 23, ...
Possible to call Oracle FUNCTION from .Net using Enterprise ... InvalidCastException: Object must implement IConvertible. at System. ... Browse other questions tagged oracle .net enterprise-library or ask your own ...
Enterprise Library.DATA - Nov/Dec Preview - Failed to convert ... Talk about Enterprise Library.DATA - Nov/Dec Preview - Failed to convert parameter value from a ... {"Object must implement IConvertible."} ...
Live Search QnA - C#.NET Error - Object Must Implement ... NET Error - Object Must Implement IConvertible. What does it mean? ... Most of these errors have corrected with the new versions of the Enterprise Library. ...
Possible to call Oracle FUNCTION from .Net using Enterprise ... InvalidCastException: Object must implement IConvertible. at System.Convert. ... How to use enterprise library logging in a .NET custom action ...
Enterprise Library 2006 -- Calling Oracle Procedure with Parameters "Object must implement IConvertible" ANY DOCUMENTATION LINKS OR HELPFUL SOURCE CODE FOR ORACLE USING THE ENTERPRISE LIBRARY WOULD BE MUCH ...
DotNetJunkies :: The #1 .NET Community for Developers Ineer Exception is like this : {"Object must implement IConvertible."} is There any issue with Applicationblocks of enterprise Library jan 2006 ? ...
Object must implement IConvertible. InvalidCastException: Object must implement IConvertible. ..... NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem ...
Feedback: System.Data.OracleClient.OracleDataAdapter can not cope ... ... value from a Guid to a String” / “Object must implement IConvertible” ... ( Given that the enterprise library does not even cope with the ...
microsoft.public.dotnet.framework.adonet Where is SMO?, Paul Ritchie; How to fix the 'Object must implement IConvertible' error when using the Enterprise Library, Jason Kolb ...






server not caching data.

microsoft muip c#

retrieving data for a specific user

enterprise librart 2.0 - email tracelistener, can you specify stmp server login credentials???

ms access/sql server 2000 not updating ..need help!!

unable to open sln files in vs2002

cachedependency error

combining several *.config into one single config file

logging application block - format timestamp

blocking popup window

connection pool, timed out...

empty message column when logging an exception to database

user controls

the operator like seems not to work (query codebuilder)

is updater block deprecated?

what is sqlhelper

urgent help:applicationblocks

enterprise library 3.1(dotnet 2.0)

using sqlhelper and store procedure in sql server 2005

executereader opens an extra connection in the pool

xml config not loading as advertised

exception quickstart & v1.1 framework?

crud generator for sql server/vb

step into enterprisr library does not work, please help

caching examples and/or articles wanted

is following true or false?

how to use the data application block from .net remoting classes?

sqlhelper and tranactions

application datablocks sqlhelper.executereader

is microsoft kidding with this thing?

   
  Privacy | Contact Us
All Times Are GMT