Inserting updating and deleting data with the sqldatasource

Rated 4.52/5 based on 602 customer reviews

You must configure the data source so that it supports the automatic operations.You also need to set the Data Key Names property of the table views in the grid so that the insert, update, and delete operations perform as expected.For example if the column name is Name its corresponding parameter name will be @Name.Once this is done the Sql Data Source will automatically pick values from respective Text Boxes inside the Grid View row to be edited. When I had my orig code, the label would output the parameter defaultvalue, insert statement would work, but NO RECORD would get inserted. Double click the yellow triangle and you will get a browser popup window with the javascript error message. The fields you see are only a few of many and I am building the form for inputting. To String(); It simply say 'error on page' in the status area of the browser. I cannot do this by setting the Insert Command property to an INSERT statement.What I found is that I could use a Stored Procedure. Could I attache some C# code to the Sql Data Source that does the insert?

For a live example that demonstrates automatic data source operations, see Automatic operations. Insert(); I put in your lines, which were slightly diff then mine, took out the defaultvalue lines, but no record is getting inserted, just error on page, no asp error is showing. Now where getting somewhere, it was a null value issue(why do I even have them defined that way? Once it is bound to a Data Source control that supports Insert, Update, and Delete operations, Rad Grid can take an advantage of the data source capabilities to perform the required operations with no code except error handling required.In order to achieve this, you need to set the following three properties: The automatic data source operations only work when binding the grid to a declarative data source using the Data Source ID property of the grid.

Leave a Reply