best choice in gridview

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,
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top