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
mash alyy
NA
12
6.8k
Modify record in datagridview and update to access db
Jul 27 2012 4:29 AM
hi.
I want to modify the record in datagridview, after modifying when I press Modify button it should update to access 2007 database and should display the updated record back to datagridview control.
Db name: stpl
table name: Equipments
My code is:
Try
Mycn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & System.Environment.CurrentDirectory & "\STPL.accdb")
Command = New OleDbCommand("SELECT * FROM Equipments", Mycn)
Mycn.Open()
Dim myDA As New OleDbDataAdapter
myDA = New OleDbDataAdapter(Command)
Dim myDataSet As DataSet
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(myDA)
myDataSet = New DataSet()
myDA.Fill(myDataSet, "Equipments")
Mycn.Close()
DataGridView1.DataSource = myDataSet.Tables("Equipments").DefaultView
txtMan.Focus()
Mycn = Nothing
Catch ex As Exception
MessageBox.Show("Could not Load the Record")
Mycn.Close()
End Try
But the code is doing nothing when I modify the data, no error and no updation to access db.
Plz help me out.
Reply
Answers (
2
)
Difference between setup project and setupwizard
What is the use of static class in C#