locked
facing problem in edit, update, create new data RRS feed

  • Question

  • User-1585918428 posted

    hi all,

    i am facing some problem in update, edit and even create new data into my access database using data detail view.

    i am using microsoft visual web developer 2008, i can do the same when sql server database were to store the data.

    but when i try to do the same using access database, an application error.

    may i know whats going wrong? and how to solve this problem?

    thanks a lots

    garf


    Thursday, April 8, 2010 10:33 AM

Answers

All replies

  • User1230423310 posted

    You have to be more specific. What is the error that is shown?

    Perhaps it's just something you have to change in the connectionString.

    Thursday, April 8, 2010 11:01 AM
  • User-1585918428 posted

    now i have no problem when i edit the data of my access database.

    but when i insert a new data into the database. it comes to below error.

    how to solve?

    thanks


    Server Error in '/test_update' Application.

    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.ExecuteCommandTextErrorHandling(OleDbHResult hr) +1003520
    System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +255
    System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +188
    System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +58
    System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +161
    System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +113
    System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +386
    System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +227
    System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +86
    System.Web.UI.WebControls.FormView.HandleInsert(String commandArg, Boolean causesValidation) +272
    System.Web.UI.WebControls.FormView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +676
    System.Web.UI.WebControls.FormView.OnBubbleEvent(Object source, EventArgs e) +95
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.FormViewRow.OnBubbleEvent(Object source, EventArgs e) +113
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
    System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
    System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    Thursday, April 8, 2010 9:03 PM
  • User-1636183269 posted

    check you are not passing ID in insert, it will automatically generate and more details check http://forums.asp.net/p/1116521/1732954.aspx

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 8, 2010 9:07 PM
  • User-1585918428 posted

    thanks for the link.

    my problem was sloved.



    Thursday, April 8, 2010 9:54 PM
  • User-1636183269 posted

    It is my pleasure :)

    Thursday, April 8, 2010 9:56 PM
  • User-1585918428 posted

    hi,

    it works when i try it in my pc.....

    but once i upload the file to my web host... when i try to insert data. it doesnt work this time Frown

    what can i do to solve this?

    thanks for your assistants.....

    Thursday, April 15, 2010 11:40 AM
  • User-1199946673 posted

    but once i upload the file to my web host... when i try to insert data. it doesnt work this time Frown

    what can i do to solve this?

     

    Start by catching the error and tell us what it says? And show us the code you've so far?

    Thursday, April 15, 2010 11:44 AM