TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amol
NA
208
193.7k
Update gridview editable changes to dataset inturn to a sql table
Nov 12 2012 12:07 PM
Update gridview editable changes to dataset inturn to a sql table
Here is my .aspx page
<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
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
Reply
Answers (
1
)
how to bind datatable to gridview also sorting in gridview with example? in asp.net with c# language
How to create Photo Album in asp.net like Facebook