newbie question: gridview, how to automatically update all fields

newbie question: gridview, how to automatically update all fields

am 23.01.2008 23:42:37 von 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

RE: newbie question: gridview, how to automatically update all fields

am 24.01.2008 17:00:00 von Manish

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

"Mark" wrote:

> 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
>