Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
sqlqrystrng = "UPDATE temp_zone set zone_id = @zoneid, zone_name = @zonename WHERE auto_id = @autoid"
Dim strautoid As String = GridView1.Rows(e.RowIndex).Cells(1).Text()
End Sub
但strautoid总是包含“”......怎么办
gridview的html
<asp:GridView ID="GridView1" runat="server" "AutoGenerateColumns="False" GridLines="None">
<RowStyle BackColor="#CCFFFF" ForeColor="#333333" />
<Columns>
<asp:TemplateField HeaderText="Auto Id">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("auto_id") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Zone Id">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("zone_id") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="grdtxt_id" runat="server" Text='<%# Eval("zone_id") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField HeaderText="Edition" ShowEditButton="True" CausesValidation="False" />
<asp:CommandField HeaderText="Deletion" ShowDeleteButton="True" CausesValidation="False" />
</Columns>
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>