Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Refreshing' SQLDataSource with new data
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346714
Message ID:
01346826
Views:
13
>>Now we put code in RowDeleting (my colleague's attempts) and the RowDeleted event is never fired as well as this code doesn't seem to do the job. Can you help a bit here?
>
>I don't think RowDeleted fires when you're manually using your own dataset instead of the SqlDataSource.
>


>Calling Delete on the row just flags it for deletion.

So, the row is supposed to be deleted automatically, correct?

You have to call AcceptChanges() on the DataTable.

Can you please elaborate on that? Our delete should not be a delete, it should set Deleted flag on the table.

Also, I wouldn't call Session.Clear() - you can just update the session var via: Session["dts"] = dts;

Good point. Bad coding practice here.

>
>Session.Clear() blows away any other session variables which is usually a bad idea.
>
>You may also really want to look into using parameters for your SQL update clause - viewstate can be hacked.

you mean run even this simple UpdateCommand with parameter, correct? In fact, I have a little SP for this as well, so we may call it instead with parameter.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform