best choice in gridview

  • Thread starter Thread starter André Freitas
  • Start date Start date
A

André Freitas

I got a gridview, and i have two choices:

Keep a few fields i need in datakeys, then call a procedure passing all the
parameters that i need to do a insert into.

or

Keep only the id in datakeys, then get the rest of the parameters inside the
procedure with a select?

What's the best aproach, and why?

I think the first choice its best in preserve the database resources,
because i ll not need to do a new select. An the second choice for security
issues, and more error free. What about you guys?

Thx
Regards,
 
I got a gridview, and i have two choices:

Keep a few fields i need in datakeys, then call a procedure passing all the
parameters that i need to do a insert into.

or

Keep only the id in datakeys, then get the rest of the parameters inside the
procedure with a select?

What's the best aproach, and why?

I think the first choice its best in preserve the database resources,
because i ll not need to do a new select. An the second choice for security
issues, and more error free. What about you guys?

Thx
Regards,

DataKeyNames stores keys in a ViewState, that means, this information
will be sent to the client. Large gridview and many other controls
make ViewState big. A large ViewState slows down browsing due to
larger page sizes. Because of this I would choose the second aproach,
however I think it would make sense to test first approach too.
Reducing number of unnecessary queries could help when database is
slow
 
Back
Top