Click here to Skip to main content
16,022,236 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have a gridview and sql datasource and i made the gridview editable via using and SQl datasource.
So when i am configuring the sql datasource i need to provide the sql table i want to load and update. Like below code would be generated on aspx form as update command.

UpdateCommand=
"UPDATE [Products] SET [ProductName] = @ProductName,
[UnitPrice] = @UnitPrice, [Discontinued] = @Discontinued
WHERE [ProductID] = @ProductID">

What I have tried:

So my concern is, my table name i want to display and update will change dynamically. So this implicit way is not proper. So the table name should given dynamically and update command should be generated for the same. So can anyone help me to find the better way of updating an entire row of gridview if i am not sure about the table name and fields?
Table name i can pass through a variable but while writing update command how can i supply fields?
anyone got my concern?
Posted
Updated 8-Aug-18 18:56pm
Comments
Member 13858616 7-Aug-18 7:15am    
Or Is there any easy way to write a table update command with out specifying the entire fields in the table?

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900