Geir,
There are loads of examples on various specialist websites:
www.123aspx.com
is a good place to bookmark.
I can tell you from my own experience I didn't want to use the default
asp.net methods of working with the datagrid, so I rolled my own after
learning from Microsoft and other examples.
Basically, I use stored procedures for all db read/write operations and do
all grid databinding in custom (VB) procedures.
So a page's code-behind might look something like:
Sub page_load (...) Handles ...
if Not page.ispostback then
'If required, ensure user is authenticated/authorised
'Get default data for display...
me.BindMyGrid()
end if
end sub
private sub BindMyGrid()
'Do the bind routine...
'Set up a connection to db and retrieve required data
'See my response posting for Tracey for example connection method:
'Re: Urgent: I can't update database with SqlCommand
' news:F4**********************************@microsof t.com
' news:ev**************@TK2MSFTNGP10.phx.gbl
end sub
private sub cmdSaveData(....) Handles ...
'Respond to the command button being clicked
'Validate all input
'I use try-catch statements for validation...
'Again, see the above message thread for my example technique for
validation and attaching values to send to the sproc/db
'
end sub
HTH
--
Alec MacLean
"Geir Sanne" <an*******@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
hi!!!
how am i supposed to update the db witht he changes the user make in
webpage ?
am trying to make a simple page that have a grid bound to a table.
the user can delete,add or update the grid.
how do i get the changes into the database ?
after the page is loaded the dataset is gone so the databinding only works
for reading ?
do i really have to make an array and handle the updating myself ?
regards
geir sanne