Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confused please help

Status
Not open for further replies.

AndyApp

Programmer
Dec 20, 2001
259
GB
So i'm fairly new to this .NET business i'm a asp developer at the mo. I can create pages that pull data from a database and display it no probs.

However i'm struggling with getting the data into a dataset then a datagrid and then allowing the user to update the dataset only. I don't want the change to go straight to the database.

I think were i'm falling over is where you acutally :
a) setup the dataset (as in dim ds as new dataset etc etc)
b) where you create the data adapter and pass the sql
c) where you create the table within the dataset (fill)
d) where you databind the whole thing.

I've got five datagrids on a page and a dataset with 5 table. each table can be edited. if the datagrid is 1 line then everything works fine. but if the datagrid is multi line i change one line then when i click to change the other one the first line goes back to its original value. its driving me nuts!! i think i've tried a, b, c, d in every possible position on the code behind page with varying degrees of failure!

can any1 help?

"Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway" - Jim Davis (Garfield)
 
Hi,

You simply must go through the asp.net quickstart tutorials over at:


As for your other problem, typically you have not used

if not page.ispostback then
DataBind()
end if

on Page load.

If you don't do this then all updated values are lost and the page reloads the old data.

Call DataBind() after your update.

hth
j
 
thanks sirjon.

i've solved it although not sure its the best way really. i just placed the dataset into cache then i call it when i need it and everything appears ok. could do with knowing how to clear the cache but i'm sure i'll find it in the msdn

"Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway" - Jim Davis (Garfield)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top