Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2006, 06:36 PM
Registered User
 
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data is not refreshed after an insert

Hi,

I add a record to an Access database from a detailsview. I also have a separate gridview that is filtered by a dropdown list choice. When I add the record it does not appear in the dropdown list choice or in the gridview. If I reconnect to the web site however, it shows up properly. What am I doing wrong.

Thanks,

Tom
 
Old January 16th, 2006, 02:26 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default



Hi Tom,

After inserting records to the database you have to populate the gridview & dropdown list again. Then it will select newly inserted records also.

if you post the code we can help you to figure out the exact problem.

nalla.



 
Old January 16th, 2006, 02:31 PM
Registered User
 
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi nalla,

Thanks for your reply. I would like to automate the reposting of the data to the grid so that when a record is added in the grid it appears automatically. Is there an easy way to do this?

Thanks, Tom


 
Old January 19th, 2006, 12:24 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


   If you've written posting data to the grid part in the page load or calling posting data to the grid function in page load that's ok.

   but i remember i faced a same kind of problem with access database. I did a insert to a access table and after that selected all the records in that table, but it doesn't show newly inserted record. it only showed that record only if i execute the select command after few seconds inserting the record to the table.

   What i did is i included these query executions in a transaction control.then it was ok. so use a transaction control when inserting records.


nalaka hewage





Similar Threads
Thread Thread Starter Forum Replies Last Post
Onload frame is refreshed and page is not found taraprasad Pro JSP 1 January 14th, 2008 04:59 AM
all frames getting refreshed using struts tiles ramanadyv Struts 0 November 24th, 2006 01:46 AM
The page cannot be refreshed without sending ... toshi Javascript 2 September 26th, 2006 03:00 AM
Returning to Parent page with refreshed New Data warrenb24 General .NET 0 February 22nd, 2005 08:45 AM
ASPX page not getting refreshed swanand VS.NET 2002/2003 1 September 15th, 2003 09:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.