-1

私はこのコードを MVC に変更する方法を知りません。

データベースのコンポーネントの変更、編集、削除についてです

私はそれを理解し、最大3日でそれを行う必要があります。多くのthx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="1_DetailsView.aspx.cs"          Inherits="GridView_Edit._1_DetailsView" %>

<!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:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="299px" 
        AutoGenerateRows="False" DataKeyNames="idL" DataSourceID="SqlDataSource1" 
        AllowPaging="True" CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
        <EditRowStyle BackColor="#2461BF" />
        <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
        <Fields>
            <asp:BoundField DataField="idL" HeaderText="idL" InsertVisible="False" 
                ReadOnly="True" SortExpression="idL" />
            <asp:BoundField DataField="krstne" HeaderText="krstne" 
                SortExpression="krstne" />
            <asp:BoundField DataField="spec" HeaderText="spec" SortExpression="spec" />
            <asp:BoundField DataField="datNar" HeaderText="datNar" 
                SortExpression="datNar" />
            <asp:CommandField ShowEditButton="True" />
            <asp:CommandField ShowInsertButton="True" />
            <asp:CommandField ShowDeleteButton="True" />
        </Fields>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
    </asp:DetailsView>
    <!-- Datum sa neUpdejtuje ;) -->
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:PoliklinikaConnectionString3 %>" 
        SelectCommand="SELECT * FROM [Lekari]"
        UpdateCommand="Update [Lekari] SET krstne=@krstne, spec=@spec WHERE idL=@idL" 
        InsertCommand="Insert [Lekari] Values(@krstne, @spec, @datNar)"
        DeleteCommand="Delete [Lekari] Where  idL=@idL"
        ></asp:SqlDataSource>

   </div>
   </form>
 </body>
</html>
4

1 に答える 1