WARNING AND NOTICE

All tricks in this blog are only for educational purpose. Learn these tricks only for your knowledge. Please donot try these to harm any one. We will not take any responsibility in any case. All softwares and tools on this site are here for private purposes only and If you want to use a software for business purpose, please purchase it. I do not host many of these tools. I Post links that I have found from numerous Search engines. I will not be responsible for any of harm you will do by using these tools.

Readmore

Thursday, September 23, 2010

Microsoft Visual C# 2005 ASP.NET 2.0 Data Binding

Data binding A mechanism for displaying and modifying dynamic data from a Web page ASP.NET supports data binding Can point controls to database table as source fordata Displayed content drawn from table Interface for modifying data built into some controls(update, delete, insert) Data Binding Client Browser Web Server Default.aspx QuotesDatabase Data-binding Several ASP.NET controls designed to bindto data GridView Display/edit a database table as a grid Details View Display one table row at a time, insert new items Bulleted List Display a list of items from a table Many more … Sql Data Source control handles data retrieval,inserts, updates, and deletes Acts as bridge between database and data-bound control Contains SQL statements to perform database calls 1. Set page to Design mode2. Open Database Explorer3. Drag table onto page4. Select desired options5. Optionally Auto Format…6. Edit Columns and setID column Visible=false Generated Source “/> SQL Parameters SQL supports parameters to fill values in dynamically Microsoft? SQL Server™ syntax is @varname Before executing statement, parameters must be associated with values UPDATE Quotes SET Author=@Author WHERE ID=@ID How to associate parameters with Sql Data Source “Select Command=”SELECT [ID], [Author], [Quote] FROM [Quotes]“Update Command=”UPDATE Quotes SET Author=@Author, Quote=@Quote WHERE ID=@ID”Delete Command=”DELETE FROM Quotes WHERE ID=@ID”> Add Update and Delete commands with parameters List parameter names and types Note: Parameters should always be named the same as the corresponding column names to work properly with the Grid View and Details View controls.

Download Microsoft Visual C# 2005 ASP.NET 2.0 Data Binding.


0 comments:

Post a Comment