.NETGURU
Postback issues
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.adonet.

Post a new message to this list...

John Smith
Dim index As Integer

index = e.Item.ItemIndex

DsSchedule1.Monday_Schedule.Rows(index).Delete()

OleDbDataAdapter2.Update(DsSchedule1, "Monday_Schedule")

dgMonday.DataBind()

now everytime i run this say in a datagrid with three items everytime time i
refresh after deleting say teh top item all subsequent items get deleted.
How do i stop this?

Reply to this message...
 
    
Max
I am getting the same problem and I can't find the solution.
What is happening is that after you delete something from the datagrid
for example and then do browser refresh the DeleteCommand will fire
again and I am clueless why this is happening.
One way to deal with it is to place something like this at the end of
your event:
'Redirect back to this page when done
Response.Redirect(Request.Path)

but do you need to be doing that? probably not, I think it's asp.net
fault

"John Smith" <Click here to reveal e-mail address> wrote in message news:<4131afb0$0$22832$Click here to reveal e-mail address>...
[Original message clipped]

Reply to this message...
 
    
Teemu Keiski
Where do you assign the DataSet as data source for the dataGrid?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"John Smith" <Click here to reveal e-mail address> wrote in message
news:4131afb0$0$22832$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
John Smith
in the ide, property builder
"Teemu Keiski" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
John Smith
Basically, I run the page.

- I add data to the dataset/database using a textbox
- The problem also happens here as if i press f5 it will keep adding the
same data to the database
- I go to delete (a button column in the datagrid)
- Does delete the record but if I press f5 to refresh it will keep deleting
the records.

Thus because it is having the same kind of problem (just vice-versa) I am
thinking its a postback problem. What I want it to do is when I 'add' an
item if say i do press refresh it won't submit it again and if I press
'delet' it delete the record I choose and thats it.

"John Smith" <Click here to reveal e-mail address> wrote in message
news:4131c2d5$0$22822$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Cor Ligthert
John,

I do not know if it is the isue however because you are so sure of that.

If not Ispostback then
'will means that it is only processed the first time
End if

By the way for this kind of questions you get probably quicker an answer in
the very active newsgroup

microsoft.public.dotnet.framework.aspnet

I hope this helps?

Cor

[Original message clipped]

Reply to this message...
 
 
System.Data.DataSet




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification