skip to content »

Inserting updating and deleting data with the sqldatasource

inserting updating and deleting data with the sqldatasource-53

In Grid View, the Edit/Update/Delete feature is an inbuilt one and can be achieved without writing a line of code with the help of Data Source controls.Likewise, the List View control also have inbuilt Edit/Update/Delete feature and additionally, insert feature is also introduced as an inbuilt one.

inserting updating and deleting data with the sqldatasource-62inserting updating and deleting data with the sqldatasource-47inserting updating and deleting data with the sqldatasource-16

We don't want delete and cancel buttons to cause validation, so set Causes Validaion property of these buttons to false.Another possibility is that you're working with a non-updatable view.A more subtle difference seems to be with the location of the database. NET forums reports that when working with SQL Server Express, they experienced this problem because the file was not in the App_Data folder.If the Generate checkbox isn't enabled, there's something in your Select query or database that makes it impossible to update.The most common situation by far is that the Select statement does not contain the primary key for the table in question.Please watch Part 23 and Part 24, before proceeding with this video.

We will be modifying the example, that we used in Part 24. Now, include a template field in the place of Command Field.

In Part 24, we discussed about achievieng the same, using Object Data Source control.

It is also possible to perform insert, update and delete on gridview, without using datasource controls at all, and that's what we will discuss in this video.

Now you can ask questions directly to me on my new site ASPForums.

Net Question Answer site, specially started to allow visitors of this site ask their doubts and queries. Just click the Ask Now button and ask your question now.

This suggests a permissions problem, but I haven't investigated further.