Updating database using gridview
The full code for these demos is available in the download at the end of this article.
The demos available for download at the end of this article illustrate different techniques for deleting data into the table of the Northwind database.
__________________________________________________ Sincerely, Young Fang Microsoft Online Community Support Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
This can be beneficial to other community members reading the thread.
I am trying to update the database from my web form grid.
The source may be: a hard-coded value like "3.95", which would return all products less than .95; the value of a Web control on the page, allowing the user to enter a price bound in a Text Box; from the querystring; from session state; and so on.After completing the above steps, your Grid View's declarative markup should look similar to the following: This example illustrates only the simplest facilities of the Grid View and omits commonly requested features, such as providing a messagebox confirming the delete. Sql Data Source Command Event Args) Handles Products Data Source. 'There are many ways you can accomplish this - use a Sql Data Source control, write code to query the database... Close() 'Prohibit the delete if price is not a database NULL AND it is greater than If Not Convert. To Decimal(price) ) is displayed, explaining to the user that they cannot delete the specified product due to its price.