Miha
Fri Dec 01 01:48:30 CST 2006
Hi Mario,
"Mario G." <MarioG@discussions.microsoft.com> wrote in message
news:3F716F23-2855-43F8-B11B-757987D74069@microsoft.com...
> Hi Miha,
>
> I'm not sure what I was thinking when I added the DataReader in the first
> 2
> options. What I meant was utilizing the SqlCommand with either a
> CommandType.Text or CommandType.StoredProcedure. I know stored procedures
> execute quicker as they are already compiled but my concern was having
> 150+
> Parameters to pass to the stored procedure. Which would be faster.
Both approaches require parameters, so no big difference there. Furthermore,
there isn't a significant performance difference between the two approaches.
SP approach should be a bit faster because you are sending less data over
the wire I suppose.
>
> As for the DataSet and DataAdapter method (my option #3), what would be
> the
> best method to accomplish this?
>
> In light of the new details would you still recommend utilizing the
> DataSet
> + DataAdapter over the SqlCommand to insert the record (with over 150
> columns)?
Definitely the best approach. It does same job as you would done manually +
it supports batching. And batching improves performance dramatically.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog:
http://cs.rthand.com/blogs/blog_with_righthand/