Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
- <!DOCTYPE html>
- <html>
- <head id="Head1" runat="server">
- <title>Manage Data</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <table bgcolor="gray">
- <%--Authors--%>
- <tr>
- <td valign="top">
- <asp:GridView ID="GridView1" AllowSorting="True" AllowPaging="True"
- runat="server" DataSourceID="SqlDataSource2" DataKeyNames="authorID"
- AutoGenerateColumns="False" Width="500px" SelectedIndex="0"
- OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
- OnPageIndexChanged="GridView1_PageIndexChanged"
- OnRowDeleted="GridView1_RowDeleted" OnSorted="GridView1_Sorted" BackColor="White"
- BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical">
- <AlternatingRowStyle BackColor="White" />
- <Columns>
- <asp:CommandField ShowSelectButton="true" ShowDeleteButton="true" />
- <asp:BoundField DataField="authorID" HeaderText="ID" ReadOnly="True"
- SortExpression="authorID" InsertVisible="False" />
- <asp:BoundField DataField="authorName" HeaderText="Name"
- SortExpression="authorName" />
- </Columns>
- <FooterStyle BackColor="#CCCC99" />
- <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
- <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
- <RowStyle BackColor="#F7F7DE" />
- <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
- <SortedAscendingCellStyle BackColor="#FBFBF2" />
- <SortedAscendingHeaderStyle BackColor="#848384" />
- <SortedDescendingCellStyle BackColor="#EAEAD3" />
- <SortedDescendingHeaderStyle BackColor="#575357" />
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource2" runat="server"
- SelectCommand = "SELECT authorID, authorName FROM authors"
- DeleteCommand = "DELETE FROM authors WHERE authorID = @authorID"
- ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
- ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>" >
- </asp:SqlDataSource>
- </td>
- <td valign="top">
- <asp:DetailsView AutoGenerateRows="False" DataKeyNames="authorID"
- DataSourceID="SqlDataSource3" HeaderText="Author Details"
- ID="DetailsView1" runat="server" Width="275px"
- OnItemUpdated="DetailsView1_ItemUpdated"
- OnItemInserted="DetailsView1_ItemInserted"
- OnDataBound="DetailsView1_DataBound" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" >
- <AlternatingRowStyle BackColor="White" />
- <EditRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
- <Fields>
- <asp:BoundField DataField="authorID" HeaderText="ID" ReadOnly="true"
- SortExpression="authorID" />
- <asp:BoundField DataField="authorName" HeaderText="Name"
- SortExpression="authorName" />
- <asp:BoundField DataField="email" HeaderText="Email"
- SortExpression="email" />
- <asp:BoundField DataField="sex" HeaderText="Sex"
- SortExpression="sex" />
- <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
- </Fields>
- <FooterStyle BackColor="#CCCCCC" />
- <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
- <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
- <RowStyle BackColor="#F7F7DE" />
- </asp:DetailsView>
- <br />
- <br />
- <asp:SqlDataSource ID="SqlDataSource3" runat="server"
- SelectCommand = "SELECT authorID, authorName, email, sex FROM authors WHERE authorID = ?"
- UpdateCommand = "UPDATE authors SET authorName = @authorName, email = @email, sex = @sex WHERE authorID = @authorID"
- InsertCommand = "INSERT INTO authors ( authorName, email, sex) VALUES ( @authorName, @email, @sex)"
- ConnectionString="<%$ ConnectionStrings:ConnectionString5 %>"
- ProviderName="<%$ ConnectionStrings:ConnectionString5.ProviderName %>" >
- <SelectParameters>
- <asp:ControlParameter ControlID="GridView1" Name="authorID" PropertyName="SelectedValue" Type="String" />
- </SelectParameters>
- <UpdateParameters>
- <asp:Parameter Name="authorName" Type="String" />
- <asp:Parameter Name="authorID" Type="String" />
- <asp:Parameter Name="email" Type="String" />
- <asp:Parameter Name="sex" Type="String" />
- </UpdateParameters>
- <InsertParameters>
- <asp:Parameter Name="authorName" Type="String" />
- <asp:Parameter Name="email" Type="String" />
- <asp:Parameter Name="sex" Type="String" />
- </InsertParameters>
- </asp:SqlDataSource>
- </td>
- </tr>
- <%--Publishers--%>
- <tr>
- <td valign="top">
- <asp:GridView ID="GridView2" AllowSorting="True" AllowPaging="True"
- runat="server" DataSourceID="SqlDataSource1" DataKeyNames="pubID"
- AutoGenerateColumns="False" Width="500px" SelectedIndex="0"
- OnSelectedIndexChanged="GridView2_SelectedIndexChanged"
- OnPageIndexChanged="GridView2_PageIndexChanged"
- OnRowDeleted="GridView2_RowDeleted" OnSorted="GridView2_Sorted" BackColor="White"
- BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical">
- <AlternatingRowStyle BackColor="White" />
- <Columns>
- <asp:CommandField ShowSelectButton="true" ShowDeleteButton="true" />
- <asp:BoundField DataField="pubID" HeaderText="PID" ReadOnly="True"
- SortExpression="pubID" />
- <asp:BoundField DataField="pubName" HeaderText="Name"
- SortExpression="pubName" />
- </Columns>
- <FooterStyle BackColor="#CCCC99" />
- <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
- <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
- <RowStyle BackColor="#F7F7DE" />
- <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
- <SortedAscendingCellStyle BackColor="#FBFBF2" />
- <SortedAscendingHeaderStyle BackColor="#848384" />
- <SortedDescendingCellStyle BackColor="#EAEAD3" />
- <SortedDescendingHeaderStyle BackColor="#575357" />
- </asp:GridView>
- <asp:SqlDataSource ID="SqlDataSource1" runat="server"
- SelectCommand = "SELECT pubID, pubName FROM publishers"
- DeleteCommand = "DELETE FROM publishers WHERE pubID = @pubID"
- ConnectionString="<%$ ConnectionStrings:ConnectionString6 %>"
- ProviderName="<%$ ConnectionStrings:ConnectionString6.ProviderName %>" >
- </asp:SqlDataSource>
- </td>
- <td valign="top">
- <asp:DetailsView AutoGenerateRows="False" DataKeyNames="pubID"
- DataSourceID="SqlDataSource4" HeaderText="Publisher Details"
- ID="DetailsView2" runat="server" Width="275px"
- OnItemUpdated="DetailsView2_ItemUpdated"
- OnItemInserted="DetailsView2_ItemInserted"
- OnDataBound="DetailsView2_DataBound" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" >
- <AlternatingRowStyle BackColor="White" />
- <EditRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
- <Fields>
- <asp:BoundField DataField="pubID" HeaderText="PID" ReadOnly="true"
- SortExpression="pubID"/>
- <asp:BoundField DataField="pubName" HeaderText="Name"
- SortExpression="pubName" />
- <asp:BoundField DataField="pubCity" HeaderText="City"
- SortExpression="pubCity" />
- <asp:CommandField ShowEditButton="True" ShowInsertButton="True" />
- </Fields>
- <FooterStyle BackColor="#CCCCCC" />
- <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
- <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
- <RowStyle BackColor="#F7F7DE" />
- </asp:DetailsView>
- <br />
- <br />
- <asp:SqlDataSource ID="SqlDataSource4" runat="server"
- SelectCommand = "SELECT pubID, pubName, pubCity FROM publishers WHERE (pubID = ?)"
- UpdateCommand = "UPDATE publishers SET pubName = @pubName, pubCity = @pubCity WHERE pubID = @pubID"
- InsertCommand = "INSERT INTO publishers(pubName, pubCity) VALUES (@pubName, @pubCity)"
- ConnectionString="<%$ ConnectionStrings:ConnectionString7 %>"
- ProviderName="<%$ ConnectionStrings:ConnectionString7.ProviderName %>" >
- <SelectParameters>
- <asp:ControlParameter ControlID="GridView2" Name="pubID" PropertyName="SelectedValue" Type="String" />
- </SelectParameters>
- <UpdateParameters>
- <asp:Parameter Name="pubID" Type="String" />
- <asp:Parameter Name="pubName" Type="String" />
- <asp:Parameter Name="pubCity" Type="String" />
- </UpdateParameters>
- <InsertParameters>
- <asp:Parameter Name="pubName" Type="String"/>
- <asp:Parameter Name="pubCity" Type="String"/>
- </InsertParameters>
- </asp:SqlDataSource>
- </td>
- </tr>
- </table>
- <asp:Label ID="ErrorMessageLabel" EnableViewState="false" runat="server" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement