Asp net objectdatasource updating

Rated 4.31/5 based on 911 customer reviews

in the gridview i have few textbox, dropdownlist and one usercontrol when the user click on EDIT ( i have button called EDIT) then user able to modify the data and when the user hit UPDATE (i have update button) then i want to execute the code and rebind to gridview when i first display the gridivew i'm retriving the data from object called People make sense?

- You don't have to use it all, but it is highly recommended. The Grid View fires the Update command that was setup in the ODS Update tab to save the update to the DB. It sure makes life easier, and with the proper use of the events provided, you can accomplish just about anything you need to without writing your own code for the buttons. Since you are not using a Details View, you only need one Data Source (ODS in your case). I've got to step out for a while, so I hope the other thread will answer you questions. You need an identifier just before the method so that VS will know to make this selection available to you in the Configure Data Source dialog box.

Firstly, I handle the On Item Updating event myself and cancel the automatic event handling by setting the Form View Update Event Args. Then catch the values from Form View Update Event Args values collection, create my BL object and fill it with these values.

Of course, I have built some automation there, so I do not have to do this manually. Doesn't it seem a little silly to be put through so much pain when there should be an easier way? I'm still curious to know if this is a bug or a design feature, if its a designb feature what is the logic behind it? Row Updating() fires and you can use it to check the user's input values for bogus or dangerous data that you don't want to save to the DB. Row Updated() fires letting you know the update is complete, and you can rebind the Grid View to see the updated data in the UI. I'm not sure why you aren't using the buttons that are provided. I'm discussing using a Grid View and Details View with SQLData Sources, but the discussion is the same. i see that you are not using objectdatasource and here is what i'm trying to do in my grid i have few textbox and dropdownlist i have my own custom buttons for insert, update, delete.. - If you are wired to a Business Logic Layer, then you have to create a method in the BLL that will do the update for you. These were done automatically for me because I wired directly to a Table Adapter. User edits a row and clicks the Update link (or button) 5. You need to enter the update information into the ODS control. Using the ODS's smart tag, select Configure Data Source. Choose your business object (in your example, this should already be done, so just click Next). Click on the UPDATE tab and choose a method that will update the database: - If you are wired directly to a Table Adapter, then there should be a method to choose from in the drop down list. Now that you have an Update method specified in the ODS, when the user edits a row and selects the Update button, the Grid View will automatically save the edits to your database, and since it causes a postback, the Gridview will update as well. The table in my database has 5 columns: Event ID, Source, Event, Type and Code. Look carefully at the ODS in my example; you will see there are entries for Delete, Update, and Insert.Howdy All I've run into a problem with the Object Data Source.Normally when using an Object Data Source to update a BO Object via a BLL i would specify the Data Object Type Name. The current project I'm working on requires tracking of changes made to data (new, edited or deleted).

Leave a Reply