Why would the ObjectQualifier in the SqlDataProvider be NULL? MyInfo.Add(info) This returns an exception of an invalid cast from DBNULL to Integer in the SqlDataprovider. The only NULL value is the ObjectQualifier. Any clues? Help? Thanks Todd
A leaders job is to grow and develop adaptive capacity.
Here is where the error occurs on the SqlDataPRovider: Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & "BMS_TCBooksAuthorsAdd", bookID, authorID), Integer)
The ObjectQualifier is = "" and I get an Invalid Cast from DBNUL to Integer when this statement executes. Error Message: DotNetNuke.ModuleLoadException: Cast from type 'DBNull' to type 'Integer' is not valid. ---> System.InvalidCastException: Cast from
type 'DBNull' to type 'Integer' is not valid. at Microsoft.VisualBasic.CompilerServices.IntegerType.FromObject(Object Value) at ToddCanedy.DNN.Modules.BMS.Data.SqlDataProvider.AddTCBooksAuthors(Int32 bookID, Int32 authorID) How do you debug something like
this? If VS would tell me what object or type the cast is operating on it would really help. I'm assuming its the ObjectQualifier simply because its the only value that is not set. I don't see where I can set the ObjectQualifier value except to create it in
the web config file. _objectQualifier = objProvider.Attributes("objectQualifier") If _objectQualifier <> "" And _objectQualifier.EndsWith("_") = False Then _objectQualifier += "_" End If
Which seems to be coming from the provider section in the web.config file. But why would I need to add anything to the web.config file? The error must be some place else. 1. The database does get updated so it seems to be after the sql is run and on
reloading the page. 2. But..this is the actual location in the code that it fails. Does this mean the return code is Null? if so how could that happen? I'm all over the friggen map and confused..... ...Debugging is really an art form.... The million dollar
question: What is actually being cast from DBNULL to Integer and why? Any help would be greatly appreciated. Thanks, Todd
A leaders job is to grow and develop adaptive capacity.
Error was in the Stored Procedure I had select scope IDENTITY which is no longer the case. Thanks, This is resolved. Again stupid is what stupid does :>)
A leaders job is to grow and develop adaptive capacity.
None
0 Points
79 Posts
SqlDataProvider - ObjectQualifier is NULL
Jun 13, 2004 04:15 AM|throughput|LINK
None
0 Points
79 Posts
Re: SqlDataProvider - ObjectQualifier is NULL
Jun 13, 2004 05:25 PM|throughput|LINK
Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & "BMS_TCBooksAuthorsAdd", bookID, authorID), Integer)
The ObjectQualifier is = "" and I get an Invalid Cast from DBNUL to Integer when this statement executes. Error Message: DotNetNuke.ModuleLoadException: Cast from type 'DBNull' to type 'Integer' is not valid. ---> System.InvalidCastException: Cast from type 'DBNull' to type 'Integer' is not valid. at Microsoft.VisualBasic.CompilerServices.IntegerType.FromObject(Object Value) at ToddCanedy.DNN.Modules.BMS.Data.SqlDataProvider.AddTCBooksAuthors(Int32 bookID, Int32 authorID) How do you debug something like this? If VS would tell me what object or type the cast is operating on it would really help. I'm assuming its the ObjectQualifier simply because its the only value that is not set. I don't see where I can set the ObjectQualifier value except to create it in the web config file._objectQualifier = objProvider.Attributes("objectQualifier") If _objectQualifier <> "" And _objectQualifier.EndsWith("_") = False Then _objectQualifier += "_" End If
Which seems to be coming from the provider section in the web.config file. But why would I need to add anything to the web.config file? The error must be some place else. 1. The database does get updated so it seems to be after the sql is run and on reloading the page. 2. But..this is the actual location in the code that it fails. Does this mean the return code is Null? if so how could that happen? I'm all over the friggen map and confused..... ...Debugging is really an art form.... The million dollar question: What is actually being cast from DBNULL to Integer and why? Any help would be greatly appreciated. Thanks, ToddNone
0 Points
79 Posts
Re: SqlDataProvider - ObjectQualifier is NULL
Jun 13, 2004 05:58 PM|throughput|LINK