SqlCommand.Parameters

  • Thread starter Thread starter Brian Toothill
  • Start date Start date
B

Brian Toothill

I'm setting SqlDataAdapter.UpdateCommand (.CommandText and .Parameters).
Say the table to which I'm applying this command has a lot of columns - does
that mean I have to add a parameter (.UpdateCommand.Parameters.Add()) for
every column that I want to update (or every column that may potentially
change)?

On the same note, does that mean I have to add (to CommandText) something
simliar to "columnN = @colN" for every column?

So if my table has 50 columns, then my UpdateCommand will have 50
Parameters?

Am I asking the right questions / going about this the 'done' way?
 
Yup, you are correct.
You might use data wizard to create the adapter and commands for you..
 

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

Back
Top