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
amit_gupta14
NA
119
0
How to refresh a datagrid in C# windows application after delete/insert/updation of records
Dec 22 2004 7:19 AM
It is related to Datagrid in C# windows Applications: 1. When a row is deleted from a datagrid, it should be removed from the grid as well as from the database.It gets deleted from database but still visible on datagrid. I used datagrid.refresh but it did not work? How to do it? Basically how to refresh a datagrid after insertion/deletion/updation of records 2. When I try to navigate the records in datagrid after deletion/addition/updation of row, I get the following error message: "An Unhandled exception has occured in your application.......... Cannot Create a child list for field Test" Why it is so. I am writing the code below: Under Form_load event: cc=new Class1(); string ss="select * from test"; dt=cc.conn(ss); //dt is dataset dataGrid1.SetDataBinding(dt,"Test"); this.BindingContext[dt,"Test"].Position=0; under adding of new record: tring ins="Insert into test values("+aa+","+"'"+ss+"')"; dt=cc.conn(ins); dt.AcceptChanges(); MessageBox.Show("record added successfully"); Under Next record navigation: this.BindingContext[dt,"Test"].Position+=1; Under Previuos record navigation: this.BindingContext[dt,"Test"].Position-=1; How to handle this error?
Reply
Answers (
0
)
crucial problem about two tables in a database!!!!!!!!!!!!11
How do I prevent the datagrid from displaying its append row (the row at the end with an asterisk)?