college student dating teacher - Inserting updating and deleting data with the objectdatasource

Following markup shows you how you can configure Object Data Source control.Notice how the properties Type Name, Select Method and Insert Method are configured to use the Categories DAL components and its methods. Now I add a Command Field to the Grid View to also enable editing the data.

We don't want delete and cancel buttons to cause validation, so set Causes Validaion property of these buttons to false.

I want to use an Object Data Source with a Grid View in ASP. The Update Method works fine, but I have Problems with deleting and inserting: For question 1, I spent the quite a bit of time tracking down a very similar problem in my own code. I added just the primary key of the object to the Data Key Names and it still was just a bare instance with all fields being 'null', except the Id field. :) Adding the other fields to the Data Key Names makes them also appear in the configured Delete Method.

The second method Add Category takes Category object as parameter and then executes SQL INSERT statement to insert data in Categories table in Database.

Once the component is ready we can configure Object Data Source control to use Categories DAL component and its methods for Selecting and Inserting categories.

I am using Form View control to create user interface for inserting category in database.

Comments