Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Saving gridview data changes, ASP.NET VB grrrr...

views
     
geekster129
post Jan 30 2009, 11:11 AM

Janitor
******
Senior Member
1,180 posts

Joined: Jan 2007
From: *awaiting GPS accuracy*



QUOTE(gsrc @ Jan 30 2009, 10:28 AM)
I wanted to save the whole changes done to the dropdownlist and the date, so when user clicked the SAVE button, the whole table will be saved, but I am having problem doing it. Can anyone help?

» Click to show Spoiler - click again to hide... «


I've tried the following but in vain. No update were done.
CODE
Dim i As Integer
While (i < GridView1.Rows.Count)
       GridView1.UpdateRow(i, False)
       i += 1
End While

Am I looking at the right place? Should I be saving the dataset instead of saving the gridview instead? Any help would be appreciated thanks.
*
Did some study on Gridview and found out that there's some SQL commands that you'll put together with the Gridview control declaration. I suspect that upon running the UpdateRow method, the SQL UPDATE associated to it might be incorrect. Check if that is correct.

This post has been edited by geekster129: Jan 30 2009, 11:11 AM
geekster129
post Jan 30 2009, 11:27 AM

Janitor
******
Senior Member
1,180 posts

Joined: Jan 2007
From: *awaiting GPS accuracy*



QUOTE(unrealweapon @ Jan 30 2009, 11:21 AM)
yes.. u have to declare the update method.. u can even put store procedure as sql to do updates.
*
I think stored procedure will make your code much cleaner and more maintainable. Besides, it is much more secure, because the SP is controlled on the DBMS side.

 

Change to:
| Lo-Fi Version
0.0147sec    0.44    6 queries    GZIP Disabled
Time is now: 23rd December 2025 - 02:49 AM