Saturday, July 21, 2018
In this tutorial we will add the INSERT functionality to our GridView control.
Follow the steps below to enable insert on our GridView control.
1. Open the source view in the .aspx page and add the ShowInsertButton attribute to the <asp:CommandField element inside the <asp:GridView element
2. Click on the ">" icon on the SqlDataSource control to configure the datasource, then click on the "Configure Data Source" link
3. Click next twice until you see the "Configure the Select Statement" screen, click on the "Advanced.." button. Then check the "Generate INSERT, UPDATE, and DELETE statements" and the "Use optimistic concurrency" checkboxes. Then click "OK"
Follow the steps below to enable insert on our GridView control.
1. Open the source view in the .aspx page and add the ShowInsertButton attribute to the <asp:CommandField element inside the <asp:GridView element
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"> <Columns> <asp:CommandField ShowInsertButton="True" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" /> <asp:BoundField DataField="QuantityPerUnit" HeaderText="QuantityPerUnit" SortExpression="QuantityPerUnit" /> <asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice" SortExpression="UnitPrice" /> <asp:BoundField DataField="UnitsInStock" HeaderText="UnitsInStock" SortExpression="UnitsInStock" /> <asp:BoundField DataField="UnitsOnOrder" HeaderText="UnitsOnOrder" SortExpression="UnitsOnOrder" /> <asp:BoundField DataField="ReorderLevel" HeaderText="ReorderLevel" SortExpression="ReorderLevel" /> <asp:CheckBoxField DataField="Discontinued" HeaderText="Discontinued" SortExpression="Discontinued" /> </Columns> </asp:GridView>
2. Click on the ">" icon on the SqlDataSource control to configure the datasource, then click on the "Configure Data Source" link
3. Click next twice until you see the "Configure the Select Statement" screen, click on the "Advanced.." button. Then check the "Generate INSERT, UPDATE, and DELETE statements" and the "Use optimistic concurrency" checkboxes. Then click "OK"
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
Liên hệ Aivivu, đặt vé máy bay tham khảo
ReplyDeletevé máy bay đi Mỹ bao nhiêu tiền
giá vé máy bay từ mỹ về việt nam
bay nhật bản việt nam
vé máy bay từ đức về việt nam giá rẻ
giá vé máy bay từ canada về Việt Nam
Lịch bay từ Seoul đến Hà Nội
chuyến bay chuyên gia