none
gridview 表單修改後,無法更新資料 RRS feed

  • 問題

  •  <form id="form1" runat="server">

          <asp:accessdatasource
            id="AccessDataSource1"
            runat="server"
            datasourcemode="DataSet"
            datafile="score.mdb"
                 
            selectcommand="SELECT * FROM score"
            updatecommand="Update score SET n1=n1 WHERE mo=@mo "
            >
          
          </asp:accessdatasource>

          <asp:gridview
            id="GridView1"
            runat="server"
            autogeneratecolumns="true"
            datakeynames="mo"
            autogenerateeditbutton="True"
            datasourceid="AccessDataSource1">
            <columns>
              <asp:boundfield headertext="mo" datafield="mo"/>
              <asp:boundfield headertext="dayy" datafield="dayy"/>
              <asp:boundfield headertext="unit" datafield="unit"/>
              <asp:boundfield headertext="n1" datafield="n1"/>
              <asp:boundfield headertext="n2" datafield="n2" />
              <asp:boundfield headertext="n3" datafield="n3" />
              <asp:boundfield headertext="n4" datafield="n4" />
              <asp:boundfield headertext="n5" datafield="n5" />
              <asp:boundfield headertext="n6" datafield="n6" />
               <asp:boundfield headertext="n7" datafield="n7" />
              <asp:boundfield headertext="n8" datafield="n8" />
              <asp:boundfield headertext="n9" datafield="n9" />
              <asp:boundfield headertext="n10" datafield="n10" />
              <asp:boundfield headertext="n11" datafield="n11" />
              <asp:boundfield headertext="n12" datafield="n12" />
               <asp:boundfield headertext="n13" datafield="n13" />
              <asp:boundfield headertext="n14" datafield="n14" />
              <asp:boundfield headertext="n15" datafield="n15" />
              <asp:boundfield headertext="n16" datafield="n16" />
              <asp:boundfield headertext="n17" datafield="n17" />
              <asp:boundfield headertext="n18" datafield="n18" />
               <asp:boundfield headertext="n19" datafield="n19" />
              <asp:boundfield headertext="n20" datafield="n20" />
              <asp:boundfield headertext="n21" datafield="n21" />
              <asp:boundfield headertext="n22" datafield="n22" />
              <asp:boundfield headertext="n23" datafield="n23" />
              <asp:boundfield headertext="n24" datafield="n24" />
               <asp:boundfield headertext="n25" datafield="n25" />
              <asp:boundfield headertext="n26" datafield="n26" />
              <asp:boundfield headertext="n27" datafield="n27" />
              <asp:boundfield headertext="n28" datafield="n28" />
              <asp:boundfield headertext="n29" datafield="n29" />
              <asp:boundfield headertext="n30" datafield="n30" />
              <asp:boundfield headertext="n31" datafield="n31" />
              <asp:boundfield headertext="n32" datafield="n32" />
              <asp:boundfield headertext="n33" datafield="n33" />
               <asp:boundfield headertext="n34" datafield="n34" />
              <asp:boundfield headertext="n35" datafield="n35" />
              <asp:boundfield headertext="n36" datafield="n36" />
              <asp:boundfield headertext="n37" datafield="n37" />
              <asp:boundfield headertext="n38" datafield="n38" />
              <asp:boundfield headertext="n39" datafield="n39" />
            </columns>
          </asp:gridview>

        </form>
      </body>
    • 已編輯 hsiehfuyu 2019年11月3日 下午 12:57
    2019年11月3日 下午 12:53

所有回覆