Knowledge Share
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Knowledge Share

Knowledge is NOT Power IMPLEMENTATION of knowledge is Power!!!
 
HomePortalGalleryLatest imagesRegisterLog in

 

 Add Edit Delete

Go down 
AuthorMessage
Admin
Admin



Posts : 142
Points : 59334476
Reputation : 0
Join date : 2007-12-29
Location : Chennai

Add Edit Delete Empty
PostSubject: Add Edit Delete   Add Edit Delete Icon_minitimeMon Feb 08, 2010 11:13 am

To Add, Edit N To Delete Records

In Form Declaration
Dim dt As DataTable
Dim dr As DataRow

In Form Load Event

dt = DataSet11.Tables("courses")
To Add

dr = dt.NewRow
dr(0) = TextBox1.Text
dr(1) = TextBox2.Text
dr(2) = TextBox3.Text
dt.Rows.Add(dr)
USRUPDATE()


'To edit table row
dr = dt.Rows.Find(TextBox1.Text)
dr.BeginEdit()
dr(0) = TextBox1.Text
dr(1) = TextBox2.Text
dr(2) = TextBox3.Text
dr.EndEdit()
USRUPDATE()

'To delete aRecord
dr = dt.Rows.Find(TextBox1.Text)
dr.Delete()
USRUPDATE()


SUB USRUPDATE()
OleDbDataAdapter1.Update(DataSet11, "courses")
MsgBox("The Opeeration Done")
OleDbDataAdapter1.Fill(DataSet11, "courses")
End sub
Back to top Go down
https://knowledgeshare.forumotion.com
 
Add Edit Delete
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Knowledge Share :: .Net-
Jump to: