ado.net - Can I use SQLParameter when having a variable quantity of fields to update? -


I have a table with eighty fields, seventy of them can change based on an update process. To:

  if (process.result == 1) cmd.CommandText = "Update T set f1 = 1, f6 = 'S'"; Else if (Process.result == 2) cmd.CommandText = string.Format ("UPTATE T SET F1 = 2, f12 = {0}, f70 = '{1}'", getData (), st); And if .......  

I can customize the building process of the UPDATE statement, however I would like to use SQLParameter ; Is it possible and convenient that you see the variety of data to update?

Thank you.

If you are currently using inline string formats for each statement, Just add the SQL parameters.

The formatting of the UPDATE string can be substituted. You need to update them to the selected SQL parameters.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -