Created
July 25, 2012 00:55
-
-
Save aalvesjr/3173698 to your computer and use it in GitHub Desktop.
Crud ASPX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ManterPagamento._Default" %> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" > | |
| <head runat="server"> | |
| <title></title> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> | |
| <div> | |
| <asp:GridView ID="GridView1" runat="server" AllowPaging="True" | |
| AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" | |
| DataSourceID="Exercicio02" | |
| onselectedindexchanged="GridView1_SelectedIndexChanged"> | |
| <Columns> | |
| <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" | |
| ReadOnly="True" SortExpression="ID" /> | |
| <asp:BoundField DataField="Codigo" HeaderText="Codigo" | |
| SortExpression="Codigo" /> | |
| <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" /> | |
| <asp:BoundField DataField="Categoria" HeaderText="Categoria" | |
| SortExpression="Categoria" /> | |
| </Columns> | |
| </asp:GridView> | |
| <asp:SqlDataSource ID="Exercicio02" runat="server" | |
| ConflictDetection="CompareAllValues" | |
| ConnectionString="<%$ ConnectionStrings:MyPrecious %>" | |
| DeleteCommand="DELETE FROM [Lancamentos] WHERE [ID] = @original_ID AND [Codigo] = @original_Codigo AND [Nome] = @original_Nome AND [Categoria] = @original_Categoria" | |
| InsertCommand="INSERT INTO [Lancamentos] ([Codigo], [Nome], [Categoria]) VALUES (@Codigo, @Nome, @Categoria)" | |
| OldValuesParameterFormatString="original_{0}" | |
| SelectCommand="SELECT * FROM [Lancamentos]" | |
| UpdateCommand="UPDATE [Lancamentos] SET [Codigo] = @Codigo, [Nome] = @Nome, [Categoria] = @Categoria WHERE [ID] = @original_ID AND [Codigo] = @original_Codigo AND [Nome] = @original_Nome AND [Categoria] = @original_Categoria"> | |
| <DeleteParameters> | |
| <asp:Parameter Name="original_ID" Type="Int32" /> | |
| <asp:Parameter Name="original_Codigo" Type="Int32" /> | |
| <asp:Parameter Name="original_Nome" Type="String" /> | |
| <asp:Parameter Name="original_Categoria" Type="String" /> | |
| </DeleteParameters> | |
| <UpdateParameters> | |
| <asp:Parameter Name="Codigo" Type="Int32" /> | |
| <asp:Parameter Name="Nome" Type="String" /> | |
| <asp:Parameter Name="Categoria" Type="String" /> | |
| <asp:Parameter Name="original_ID" Type="Int32" /> | |
| <asp:Parameter Name="original_Codigo" Type="Int32" /> | |
| <asp:Parameter Name="original_Nome" Type="String" /> | |
| <asp:Parameter Name="original_Categoria" Type="String" /> | |
| </UpdateParameters> | |
| <InsertParameters> | |
| <asp:Parameter Name="Codigo" Type="Int32" /> | |
| <asp:Parameter Name="Nome" Type="String" /> | |
| <asp:Parameter Name="Categoria" Type="String" /> | |
| </InsertParameters> | |
| </asp:SqlDataSource> | |
| </div> | |
| </form> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment