02-09-07 12:18 AM
I guess I figured it out, it was simply a problem with my database column,
having a default value. This error occured after I added a new weakly typed
property to the purchase order table, I wanted to assign a default value of
false.
It wasn't till later that I realized what I did. I guess the error itself
(cannot convert dbnull to string was kinda confusing)
"Steve H." wrote:
> Hello,
>
> I was working on my MSCS 2007 site, the last I remember doing was adding a
> weakly typed property to the Purchase Ordes. OrderObjectMappings.xml, I ra
n
> the ordermapping.exe and everything was going ok.
>
> Then an error occured, an invalid Cast from DBNull to String... It occured
> on every page, as if this is happening before even processing the pages so
I
> think it's GLOBAL to the entire site.
>
> I dont remember changing any connection values or strings.
>
> Here is the trace stack and whatever information is displayed in it...
>
> Any help regarding this issue is extremely appreciated.
> Thanks
>
>
>
> Unable to cast object of type 'System.DBNull' to type 'System.String'.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information ab
out
> the error and where it originated in the code.
>
> Exception Details: System.InvalidCastException: Unable to cast object of
> type 'System.DBNull' to type 'System.String'.
>
> Source Error:
>
> An unhandled exception was generated during the execution of the current w
eb
> request. Information regarding the origin and location of the exception ca
n
> be identified using the exception stack trace below.
>
> Stack Trace:
>
> [InvalidCastException: Unable to cast object of type 'System.DBNull' t
o type
> 'System.String'.]
>
> Microsoft.CommerceServer.Runtime.Orders.OrderContext.ValidateXmlFileWithSq
l(SchemaMapping mapping, String connStr, Int32 timeout) +1238
>
> Microsoft.CommerceServer.Runtime.Orders.OrderContext.CreateSchemaAndPipeli
neMapping(SchemaMapping&
> schemaMapping, PipelineAdapter& pipelineAdapter, String appRootPath,
> CommerceOrdersConfiguration ordersConfiguration) +259
> Microsoft.CommerceServer.Runtime.Orders.OrderContext.Initialize(String
> transactionResourceConnectionString, String
> transactionConfigResourceConnectionStrin
g) +210
> Microsoft.CommerceServer.Runtime.Orders.OrderContext.Create(String
> transactionResourceConnectionString, String
> transactionConfigResourceConnectionStrin
g) +114
>
> Microsoft.CommerceServer.Runtime.Orders.CommerceOrderModule.CreateOrderCon
text() +68
>
> Microsoft.CommerceServer.Runtime.Orders.CommerceOrderModule.get_OrderConte
xt() +87
>
> Microsoft.CommerceServer.Runtime.Orders.CommerceOrderModule.OnBeginRequest
(Object sender, EventArgs e) +18
>
> System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionSte
p.Execute() +92
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
>
>
>
>
>
>
[ Post a follow-up to this message ]
|