View Single Post
  #1 (permalink)  
Old April 6th, 2006, 03:45 PM
thenextbillgates thenextbillgates is offline
Registered User
 
Join Date: Apr 2006
Location: Pensacola, Fl, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Editing Data in a DataView

I'm a beginner programmer in C# asp.NET and am currently working on a web portal as a college project. My question is, how do you change data that's in a dataview?

I have a dataset, and a dataview pointing to that dataset. (I'm away from the code at the moment, so syntax might not be perfect)

Code:
dv.table = ds.TABLE;
dv.sort = "POSITION";
dv.rowviewfilter = "ID>=" + variable;


Then I try to assign it to stuff:

Code:
dv[0]["POSITION"] = 125;


or read things out:

Code:
variable = dv[0]["ID"];


Also, I write the changes to the database using my own SQL statements.

But it doesn't seem to work. It compiles fine, but the changes don't appear on the page or in the database.

I hope this makes sense. Thanks for your help!