newbie question: gridview, how to automatically update all fields

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Newbie question, but I can't find anything either here or at ms that shows
the answer. I want to update the database by allowing the user to make
changes via gridview. I was wondering if there was an easier way to write
the UPDATE command than having to individually spell out each and every
field name.

right now I have:

UpdateCommand="Update RefInfo SET
field1=@field1,
field2=@field2,
field3=@field3,
field4=@field4,
field5=@field5,
field6=@field6,
WHERE ServerType=@ServerType">

I have 27 fields in my table, isn't there a "update everything" type of
command rather than having to spellout each individual field name and then
if I add/change a field, to manually change it?

Mark
 
Hi Mark,

I think you can use any of the DataSource control like SQLDataSource and go
to advance options and it will automatically generate a Update, delete
command for you.

Regards,
Manish
www.ComponentOne.com
 
Back
Top