Now you can ask questions directly to me on my new site ASPForums. Net Question Answer site, specially started to allow visitors of this site ask their doubts and queries. Just click the Ask Now button and ask your question now.Hi all I have a Grid View on an aspx page, that is enabled for editing, deletion and sorting. Add(Kategorinavn); string str Conn = Configuration Manager. Connection String; string str Provider = Configuration Manager. Provider Name; string select Command = "SELECT * FROM rammekategori"; Sql Data Source ds = new Sql Data Source(str Provider, str Conn, select Command); ds. Update Command = "UPDATE rammekategori SET Kategoribeskrivelse = ? "; Parameter Kategorinavn = new Parameter("Kategorinavn"); Parameter Kategoribeskrivelse = new Parameter("Kategoribeskrivelse"); ds. In the Page_Load event of the aspx page, i add a Sql Data Source to the page, and bind the source to the Grid View. The source may be: a hard-coded value like "3.95", which would return all products less than .95; the value of a Web control on the page, allowing the user to enter a price bound in a Text Box; from the querystring; from session state; and so on.Likewise, the parameter values in the Astute readers will notice the similarity between the Access Data Source and Sql Data Source controls' inserting, deleting, and updating workflows.In the manually-created Web Forms example for inserting, for example, we added Text Boxes, Drop Down Lists, and other Web controls to collect the values for the new record.A Sql Data Source control was added whose Insert Parameters referred to these controls.
Once they've selected this record, you need to show it's existing values in editable fields (textboxes, cehckboxes, and so on), let the user make any modifications, and then save them.
I want to define alle data-access information, such as SQL-statements in a lower-tier-layer, so i would be able to remove the GUI, and change it with another GUI.
NET 2.0 introduced a number of new Web controls designed for accessing and modifying data. NET 2.0's data source controls make it possible to retrieve, insert, update, and delete data without having to write the tedious dedata access code that was so commonplace in ASP. Previous installments of this article series have looked at returning, inserting, and deleting data using the Sql Data Source control. These controls can work in unison with the data source controls to facilitate inserting, updating, and deleting data.
When i click the update, or delete button, it makes a Post Back, but nothing is affected. I have also tried adding the columns manually, but no affect here either.
I'm sure this has got something to do with the parameters. The code for setting the commands, and adding the Sql Data Source to the page are as follows: string str Conn = Configuration Manager. Connection String; string str Provider = Configuration Manager. Provider Name; string select Command = "SELECT * FROM rammekategori"; Sql Data Source ds = new Sql Data Source(str Provider, str Conn, select Command); ds. Update Command = "UPDATE rammekategori SET Kategoribeskrivelse = @Kategoribeskrivelse WHERE (Kategorinavn = @Kategorinavn)"; ds.