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
nebojsa.pongracic
NA
12
0
How to update an .fdb database from a form
Sep 24 2004 3:41 PM
I can't update my firebird database from a form, while i can update it from the datagrid. I want to fill out some text boxes on a form and then save the data into a database. I'm using this function to do it, and it reports the message "Item Update Successfull!" but it doesn't actually save the data into a database :( Can someone help me? PS: this is the function i use to update stuff public void CatchSaveClick(object source, System.EventArgs e) { try { fbConnection1.Open(); FbTransaction myTxn = fbConnection1.BeginTransaction(); this.fbDataAdapter1.UpdateCommand.Transaction = myTxn; this.fbDataAdapter1.UpdateCommand.CommandText = "UPDATE Weapons SET NAME = '"+Dos.itmName.Text+"', DESCRIPTION =" + " '"+Dos.itmDescription.Text+"', WEAPON_TYPE = '"+Dos.itmTypeList.Text+"', DAMAGE_TYPE = '"+Dos.itmDamageType.Text+"', MINIMUM_DAMAGE = '"+Dos.itmMinDamage.Text+"', MAXIMUM_DAMAGE = '"+Dos.itmMaxDamage.Text+"', " + "RANGE = '"+Dos.itmRange.Text+"', SPEED = '"+Dos.itmSpeed.Text+"', WEIGHT = '"+Dos.itmWeight.Text+"', PICTURE = '"+Dos.picPath.Text+"', ITEM_PRICE = '"+Dos.itmValue.Text+"', PARRY = '"+Dos.itmParry.Text+"' WHERE ID = "+Dos.itmIDNumber.Text; fbDataAdapter1.UpdateCommand.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { fbConnection1.Close(); Reset_Grid(); MessageBox.Show("Item Update Successfull!"); } }
Reply
Answers (
0
)
Access Database into Treeview
DataAdapter.Update() "disconnects" current DataViews?