


I have a form that pulls from two other tables using ObjectDataSources that work correctly but I need to use a button to insert the record that I am creating into the table.
#INSERT USING OBJECTDATASOURCE WITH DUPLICACY CHECK HOW TO#
Several sources I've looked at say that this is a correct way of doing this but I have been unable to find out how to insert into the database using c# in the code behind file. From what I understand, the ObjectDataSourceView look after instantiating the business object and setting up its member values. ObjectDataSource can cache the value returned from the SelectMethod if we set the property EnableCaching to 'true'. The resulting dictionary is used to populate an object that will be the only parameter for the Insert method. I am using a business class that has an insert method that has an object as its parameter. Here is the KEY: perform insertion using the 'insert' method of the ObjectDataSourceView (not the ObjectDataSource) passing the collection of parameters. Using custom objects: The values dictionary is merged with a new dictionary. There is some special coding that needs to happen to get the sorting of columns to work. In this example, the ObjectDataSource returns a generic collection of an object. To find duplicate documents in a content source and type, select the same source and type in both columns. Use the dropdowns in the second column to select a content source and content type. Using the Comparing dropdowns in the first column, select a content source and content type.

This article addresses using the ObjectDataSource to populate the GridView. Click Content Duplicacy and then Add new duplicacy checker. I am attempting to learn ASP.NET and want to use an ObjectDataSource to select and insert into a database. This article attempts to show a few tricks with the new GridView that we have in ASP.NET 2.0.
