Strange issue with FormView Insert

Discussion in 'ASP.NET 2.0' started by vvsharma, Apr 27, 2007.

  1. There shouldnt be any reason for it not to work.Please make sure you are referring to the correct database.What does your connection string look like?

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  2. Thanks for the reply.
    I don't think it can be the connection string as I can connect and update other tables within the one and only database I have.
    I am using the same web.config to connect from my local machine which works fine.
    I can even update this particular table so I must be connected to it successfully, but I can not insert new records when running the app from a web browser?
    It is very strange and I can not see any reason for it - no errors are reported or anything?
     
  3. I have recently uploaded my site to a DiscountASP temporary URL to test it before amending my DNS.
    There seems to be a strange problem inserting new records in a particular tablevia a formview in my site.
    I can connect to my database from my local machine and amend and insert records fine with no problem at all.
    I canconnect tomy site via a web browser and amend and insert recordsin all but one table.
    I can even amend records in this particular table.
    But when I try to insert a new record in this table using a bog standard default formview insert it does not work?
    No errors are reported and it carries on as if everything worked OK, but no new record.
    Like I said itworks fine from my local machine and the code is identical?
    Has anyone come across anything like this before?
    Many thanks
     
  4. Just in case anyone has a similar problem, this was simply due to the date format on my insert page.
    Obviously the update pages were retrieving dates in the correct format from the databaseso these were not an issue unless the date was amended.
    To resolve the issue I just added a "globalization culture" tag in the web.config and it all works fine.
    The only thing I can't explain now is why the application didn't report any errors regarding the date format, it just failed to insert the new records?
    I am using the onItemInserted event, so maybe this hid the error, but I would have thought that this event should not have been triggered at allif the insert failed?
     

Share This Page