Re: Assign Null value error

Discussion in 'ASP .Net' started by Patrick.O.Ige, Mar 16, 2006.

  1. Post some snippet code..
    Are you using MS Access?
    Patrick

    "Jim McGivney" <> wrote in message
    news:...
    > In asp 2.0 I am trying to insert a row using a detailsview control
    > connected to an accessDataSource. I get the error message below. I am
    > having trouble identifing which data field is causing the problem. Any
    > suggestings are welcomed.
    > Jim
    > *************
    > You tried to assign the Null value to a variable that is not a Variant
    > data type.
    > 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.Data.OleDb.OleDbException: You tried to assign
    > the Null value to a variable that is not a Variant data type.
    >
    > Source Error:
    >
    > An unhandled exception was generated during the execution of the
    > current web request. Information regarding the origin and location of the
    > exception can be identified using the exception stack trace below.
    >
    > Stack Trace:
    >
    > [OleDbException (0x80004005): You tried to assign the Null value to a
    > variable that is not a Variant data type.]
    >
    > System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
    > dbParams, Object& executeResult) +177
    > System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
    > +194
    > System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
    > Object& executeResult) +56
    > System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
    > behavior, String method) +105
    > System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +88
    > System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand
    > command, DataSourceOperation operation) +392
    > System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary
    > values) +403
    > System.Web.UI.DataSourceView.Insert(IDictionary values,
    > DataSourceViewOperationCallback callback) +68
    > System.Web.UI.WebControls.DetailsView.HandleInsert(String commandArg,
    > Boolean causesValidation) +390
    > System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean
    > causesValidation, String validationGroup) +609
    > System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source,
    > EventArgs e) +87
    > System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    > +35
    > System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source,
    > EventArgs e) +109
    > System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    > +35
    > System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +86
    > System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
    > eventArgument) +153
    >
    > System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    > eventArgument) +7
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    > sourceControl, String eventArgument) +11
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +172
    > System.Web.UI.Page.ProcessRequestMain(Boolean
    > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
    >
    >
    >
    > --------------------------------------------------------------------------------
    > Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    > ASP.NET Version:2.0.50727.42
    >
    Patrick.O.Ige, Mar 16, 2006
    #1
    1. Advertising

  2. Patrick.O.Ige

    Jim McGivney Guest

    Yes it is an access database.
    There is no code, it was all put together with the detailsview smart-tag.
    Jim

    "Patrick.O.Ige" <> wrote in message
    news:eKfBH$...
    > Post some snippet code..
    > Are you using MS Access?
    > Patrick
    >
    > "Jim McGivney" <> wrote in message
    > news:...
    >> In asp 2.0 I am trying to insert a row using a detailsview control
    >> connected to an accessDataSource. I get the error message below. I am
    >> having trouble identifing which data field is causing the problem. Any
    >> suggestings are welcomed.
    >> Jim
    >> *************
    >> You tried to assign the Null value to a variable that is not a Variant
    >> data type.
    >> 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.Data.OleDb.OleDbException: You tried to assign
    >> the Null value to a variable that is not a Variant data type.
    >>
    >> Source Error:
    >>
    >> An unhandled exception was generated during the execution of the
    >> current web request. Information regarding the origin and location of the
    >> exception can be identified using the exception stack trace below.
    >>
    >> Stack Trace:
    >>
    >> [OleDbException (0x80004005): You tried to assign the Null value to a
    >> variable that is not a Variant data type.]
    >>
    >> System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
    >> dbParams, Object& executeResult) +177
    >> System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
    >> executeResult) +194
    >> System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior,
    >> Object& executeResult) +56
    >> System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
    >> behavior, String method) +105
    >> System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +88
    >> System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand
    >> command, DataSourceOperation operation) +392
    >> System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary
    >> values) +403
    >> System.Web.UI.DataSourceView.Insert(IDictionary values,
    >> DataSourceViewOperationCallback callback) +68
    >> System.Web.UI.WebControls.DetailsView.HandleInsert(String commandArg,
    >> Boolean causesValidation) +390
    >> System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean
    >> causesValidation, String validationGroup) +609
    >> System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source,
    >> EventArgs e) +87
    >> System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    >> +35
    >> System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source,
    >> EventArgs e) +109
    >> System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    >> +35
    >> System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +86
    >> System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
    >> eventArgument) +153
    >>
    >> System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    >> eventArgument) +7
    >> System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    >> sourceControl, String eventArgument) +11
    >> System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    >> +172
    >> System.Web.UI.Page.ProcessRequestMain(Boolean
    >> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    >> +4921
    >>
    >>
    >>
    >> --------------------------------------------------------------------------------
    >> Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    >> ASP.NET Version:2.0.50727.42
    >>

    >
    >
    Jim McGivney, Mar 16, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    26,493
    Mike Schilling
    Mar 29, 2006
  2. Learner
    Replies:
    4
    Views:
    7,232
    Steve C. Orr [MVP, MCSD]
    Apr 25, 2006
  3. nrhayyal
    Replies:
    8
    Views:
    293
    Bogdan Sintoma
    Sep 22, 2005
  4. Col
    Replies:
    1
    Views:
    611
    peter koch
    Apr 21, 2006
  5. S S
    Replies:
    2
    Views:
    1,225
    Andrey Tarasevich
    Dec 15, 2008
Loading...

Share This Page