Advice needed : stored procedures or datasets?

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

Hello,

I'm working on a project in which i use Sql Server stored procedures
to add and modify the records of our customers. This works fine, but
when writing these stored procedures, i must use a lot of parameters
(around 20) to add or modify a customer. It's long to write but i can
deal with that.

However, i was wondering if it is really efficient. In this case are
stored procedures with many parameters better than using a dataset to
add/modify a record?

Also, i was wondering what is the best solution to bind data to a
control. In my project i use SqlDataReader objects that i load with a
stored procedure, then i bind the data to the control with the
DataReader. Is this the best solution?

Thanks for any tips!
 
Stored Procedures are the way to go 95% of the time. They are precompiled
and very efficient.
If you drag a DataAdapter control onto a web form (from your toolbox) then
there is a nice wizard that pops up that will take care of writing most of
the monotonous parameter code for you.

When you just want to quickly fill a control with read-only data then
DataReaders are the most efficient way to do this. If you want to get much
fancier than that then the advanced features of DataSets start to make them
more appealing than DataReaders.
 
Back
Top