Duration: 23 minutes
Summary: In this video, we continue our discussion of the sqlDataSource and the use of the Insert command with the <asp:Parameter>. We start by creating a database that is part of the website. We add one table named Feedback. It will be used to insert user’s feedback about a book. On the page, we add a text area where the user will be able to enter comments. We add a button to add the comments to the database. Under the button we put a gridview that displays the latest comments. In the data source we put the insert and select commands and the insert parameters. In the button’s code behind we add the parameters default values. Then we issue the insert command. Finally, we bind the grid with the DataBind() call to be able to display the latest comments from the user. The actual user added to the database is the logged in user to the site. This value is null if you do not first log in. The login code and pages are already provided to us in the web site template.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: ASP.NET and Visual Studio 2010
Keyword: ASP.NET 4, Visual Studio 2010, Database, TextBox, GridView, SqlDataSource, ConnectionString, SelectCommand, InsertCommand, Parameter, LinkButton, InsertParameters, Insert, DataBind.