In ASP. NET, we useResource customization ControlDirectly generated. When two tables are generated using SQL statements, they are simply deleted or updated 「ORA-01036:
Changing the data name failed.」. I tried to solve the problem for a long time.
Solution:
Select the data source control component. Click here to set the data source. In "set SELECT statement, select "specify data table or data row" and select "generate insert, update, and delete statement" in "high-end 」, however, you do not select the "access method 」. After the SQL statement is completed, select "set SELECT statement", select "specify the method for customizing SQL statement statements or save the existing statement", and modify the SQL statement, add the data table columns of other tables you want to use to display. Complete.
The information column that you add after adding the gridview. And set it to readonly. If the value of a column in the table to be updated does not need to be updated, add it to the future version, and set the Enable of the future to false in the future version. In this case, the value will not be blank during the update.
For some preset content related to the data volume, I am looking for an introduction about this on the Internet.
Http://www.seovip.net/edu/48/NET/200710244163.html ). As follows:
1. Why does the resource allocation Control in ASP. NET 2.0 complete the update, deletion, and creation operations without the need for metadata generation?
When ASP. NET 1.x is used, DataGrid and other controllers use the formula databinder. eval (container. dataitem, "columnname ").
You can set the resources in the resource source to the control list, but you cannot automatically retrieve new values in the Control List and update the Back-to-source information when updating the resource. So ASP. in NET 2.0, there are two types of data sets: Single-directed data set (I .e., the formula or readonly is set to true boundfield, only the information from the resource source to the control volume is provided) and the data orientation (not only can the information be set from the resource source to the control volume, in addition, the resources in the control volume can be provided to the resource source control volume during the calculation of RMB), so ASP. NET 2.0 does not require a large number of E. item. findcontrol.
2. In the update and insert processes, how does the gridview/detailsview/formview allocate value to the resource source to control the volume so that the resource source controls the volume used to complete the data operation method?
when an update is made, the gridview provides two sets of values for the resource source to control the metadata and a new set of values, the values of all columns whose readonly value is not true in the replica set and all calculation formula values in the replica set, and the values of the other Shard, from the corresponding datakey (the value of the datakey is saved to the dynamic metadata by the gridview when the value of the datakey is set ), you can see this feature in the
updating event processing program of the gridview. After the value of the parameter is provided to the resource source control component, its key will be renamed by the resource source control component root segment oldvaluesparameterformatstring. For example, if datakeynames in the gridview is set to productid, The oldvaluesparameterformatstring of the data source control vertex is original _ {0 }, then, when the gridview is updated, there will be an original_productid in the amount of records controlled by the resource source.
the combination of the new value and the old value must match the data list required by the resource source control component. There must be no more or less values, this is the most common problem for beginners when using the gridview to update information.
in actual usage, if the number of corresponding products (such as productid) in the primary keys column is ), there is no name for original_productid like strong
named dataset . You must change the oldvaluesparameterformatstring of the resource source to {0 }, in this way, we can adapt to the real method's response data.
3. How can we implement open release?
The update and division clauses in an open release will have a long where clause, for example:
Update
Table1 set column1 = @ column1, column2 = @ column2 where id = @ original_id and
Column1 = @ orignal_column1 and column2 = @ original_column2.
Similar datasets can generate such commands automatically by selecting an option that is opened and released in a high-availability selection. According to our 2nd-point discussion, we only need to add all the reserved bits in girdview's datakeynames adequacy, in this way, the value of the dataset is automatically placed into the old value set to meet the requirements of the resource source. Therefore, I
We can understand that the datakeyfield (unit number) Adequacy of the DataGrid will be converted to datakeynames adequacy ).