Details.aspx.vb:
Dim SQL As String Dim result As Boolean Dim vname As TextBox Dim vaddress As TextBox Dim vphone1 As TextBox Dim vphone2 As TextBox Dim conper As TextBox Dim conpermobno As TextBox Dim slno As TextBox slno = CType(gv.Rows(e.RowIndex).Cells(0).Controls(0), TextBox) vname = CType(gv.Rows(e.RowIndex).Cells(1).Controls(0), TextBox) vaddress = CType(gv.Rows(e.RowIndex).Cells(2).Controls(0), TextBox) vphone1 = CType(gv.Rows(e.RowIndex).Cells(3).Controls(0), TextBox) vphone2 = CType(gv.Rows(e.RowIndex).Cells(4).Controls(0), TextBox) conper = CType(gv.Rows(e.RowIndex).Cells(5).Controls(0), TextBox) conpermobno = CType(gv.Rows(e.RowIndex).Cells(6).Controls(0), TextBox) SQL = " UPDATE PMS_VENDOR_MASTER " SQL = SQL & " SET VENDOR_NAME='" + vname.Text + "', " SQL = SQL & " VENDOR_ADDRESS='" + vaddress.Text + "', " SQL = SQL & " VENDOR_PHONE='" + vphone1.Text + "', " SQL = SQL & " VENDOR_MOBILE_NO='" + vphone2.Text + "', " SQL = SQL & " VENDOR_CON_PER_NAME='" + conper.Text + "', " SQL = SQL & " VENDOR_CON_PER_MNO='" + conpermobno.Text + "'" SQL = SQL & " WHERE" SQL = SQL & " VENDOR_SYSID='" + slno.Text + "'" result = dba.ExecuteNonQuery(SQL) If result = True Then lblError.Text = "Data Update Successfully" End If Catch ex As Exception lblError.Text = ex.Message End Try gv.EditIndex = -1 gvbound()
Details.aspx
<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#666666" BorderStyle="Solid" BorderWidth="1px" CellPadding="6" CssClass="stylenormal" GridLines="Horizontal" ToolTip="List Of Present User" Width="800px" PageSize ="5" AllowPaging="True" DataKeyNames ="VENDOR_SYSID" onrowediting="gv_RowEditing" onrowcancelingedit="gv_RowCancelingEdit" onrowupdating="gv_RowUpdating" AutoGenerateEditButton="true" > <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" /> <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" /> <Columns> <asp:BoundField DataField="VENDOR_SYSID" HeaderText="SLNO" ItemStyle-HorizontalAlign="Left"> <HeaderStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:BoundField DataField="vname" HeaderText="Vendor Name" ItemStyle-HorizontalAlign="Left"> <HeaderStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:BoundField DataField="vaddress" HeaderText="Vendor Address" ItemStyle-HorizontalAlign="Left"> <HeaderStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:BoundField DataField="vphone" HeaderText="Phone Number" ItemStyle-HorizontalAlign="Right"> <HeaderStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" /> </asp:BoundField> <asp:BoundField DataField="vmobile" HeaderText="Mobile Number" ItemStyle-HorizontalAlign="Right"> <HeaderStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" /> </asp:BoundField> <asp:BoundField DataField="vconname" HeaderText="Contact Person" ItemStyle-HorizontalAlign="Left"> <HeaderStyle HorizontalAlign="Left" /> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:BoundField DataField="vconmobno" HeaderText="Contact Person Mobile Number" ItemStyle-HorizontalAlign="Right"> <HeaderStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" /> </asp:BoundField> <asp:CommandField ShowEditButton="True" /> </Columns> <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" /> <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" /> <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" /> <AlternatingRowStyle BackColor="#F7F7F7" /> </asp:GridView>