Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is my .aspx page
ASP.NET
<form id="form1"  runat="server">
    <div>
    <asp:GridView ID="GV" runat="server"  AutoGenerateColumns="false">
    <Columns>
    <asp:TemplateField HeaderText="Name">
    <ItemTemplate >
    <asp:TextBox ID="txtName" runat="server" Text='<%#Eval("Name") %>'></asp:TextBox>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="EmailId" HeaderText="Email" />
    </Columns>
    </asp:GridView>
    
    </div>
    <asp:Button ID="btnSave" runat="server" Text="Save" />
  
    </form>

Now i am binding it from code behind on page load as given below
C#
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

       If Page.IsPostBack Then

           Dim str As String = ConfigurationManager.AppSettings("DBConn")
           Dim Conn As New SqlConnection(str)
           Conn.Open()
           Dim qry As String = "SELECT * FROM dbo.Employee"
           Dim adp As New SqlDataAdapter(qry, Conn)
           Dim ds As New DataSet
           adp.Fill(ds)

           GV.DataSource = ds
           GV.DataBind()

       End If
   End Sub


Now I have textbox as a editable field and user will make the changes to those textboxes

and What i want is after click of a save button those changes to be updated in dataset and further in sql Employee table

Without any kind of loop

Please suggest
Posted
Comments
Rakesh S S 13-Nov-12 0:36am    
Anybody with hint

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900