| | |
DataGrid not Updating
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
I've tried various things to get the datagrids to update. If I close the application and reload it then I see the changes to the database. If I do a transactions I don't see them until I reload it. This is where I currently left off.
just on the savings because until I can get it to work for one grid, no sense of playing with the other. I also tried to run my closeDatabase and getDatabase() methods. That didn't work. I've included the whole application and the database in the zip.
C# Syntax (Toggle Plain Text)
bank_Account_DatabaseDataSet.GetChanges(); bank_Account_DatabaseDataSet.Savings.AcceptChanges(); this.savingsTableAdapter.Fill(this.bank_Account_DatabaseDataSet.Savings); savDtGrdVw.Refresh(); savDtGrdVw.Update();
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways - Chardonnay in one hand - chocolate in the other - body thoroughly used up, totally worn out and screaming "WOO HOO, What a Ride"
Yes I'm using Microsoft Visual C# Express 2008.
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways - Chardonnay in one hand - chocolate in the other - body thoroughly used up, totally worn out and screaming "WOO HOO, What a Ride"
Well the database in your project is not always the same! There is a copy of it in a bin folder I believe. I don't know exactly how it was, but I will look it up and let you know something as soon as possible.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
There is something wrong with your zip btw.
But.
I have a possible solution to your problem.(I think... Don't shoot me if it's not.)
The version of the database you see in solution explorer is not the same version of the database that is used by your application.
Instead the db of sol ex is copied to the output directory, where .exe file lives for example in .../bin/debug every time you run your app.
Set the property of your db called Copy to output directory to Copy If Newer and it should be ok.(I hope)
But.
I have a possible solution to your problem.(I think... Don't shoot me if it's not.)
The version of the database you see in solution explorer is not the same version of the database that is used by your application.
Instead the db of sol ex is copied to the output directory, where .exe file lives for example in .../bin/debug every time you run your app.
Set the property of your db called Copy to output directory to Copy If Newer and it should be ok.(I hope)
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
That didn't work. It doesn't matter if I point it to the root mdb, the one in Release or Debug. It will update the database in any of the three locations. I can open it in access and see the updates. But my grid view is only showing me what is loaded at run time.
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways - Chardonnay in one hand - chocolate in the other - body thoroughly used up, totally worn out and screaming "WOO HOO, What a Ride"
Not sure I follow the question?
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways - Chardonnay in one hand - chocolate in the other - body thoroughly used up, totally worn out and screaming "WOO HOO, What a Ride"
I looked a little at the BeginEdit (still going to read a little more), but I would say no I'm doing any editing with the DataGrid so I'm not using BeginEdit, EndEdit and CommitEdit methods. I'm using statements like To inject the changes directly into the database. I also was thinking I could get tricky last night. Figuring when I close the application and open it up the DataGrid loads the database fine. So I tried to create a second form form, putting a DataGrid on it. That way I can load and close it, maybe it would do the same thing as closing and opening the main form, and nope it doesn't. I did a copy and paste of the existing DataSet and adapters. So today I'm going to create it new out of the box.
C# Syntax (Toggle Plain Text)
DBcmd.CommandText = "INSERT INTO Savings VALUES('" + System.DateTime.Now.ToString() + "','" + transaction + "','" + amountTxtBx.Text + "','" + retrieveBalance + "')"; try { int row_affected = DBcmd.ExecuteNonQuery(); }
Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways - Chardonnay in one hand - chocolate in the other - body thoroughly used up, totally worn out and screaming "WOO HOO, What a Ride"
![]() |
Similar Threads
- Adding a new row in a Datagrid ??????????? (C#)
- Updating Report Problem (Visual Basic 4 / 5 / 6)
- Datagrid Operations (ASP.NET)
- update the db using values in a datagrid (VB.NET)
- updating DataGrid on Button Press (ASP.NET)
- Modify data in Datagrid (VB.NET)
- another one...selecing rows in datagrid and sorting with column headers (VB.NET)
Other Threads in the C# Forum
- Previous Thread: Maximaze Windows Forms
- Next Thread: Reading a Text File
| Thread Tools | Search this Thread |
.net access ado.net algorithm array backup barchart bitmap box broadcast buttons c# check checkbox client combobox control conversion csharp custom database databasesearch datagrid datagridview datagridviewcheckbox dataset datetime degrees development draganddrop drawing dynamiccreation encryption enum equation event excel file form format formatting forms function gdi+ httpwebrequest image index input install interface java label list listbox mandelbrot math mouse mouseclick mysql namevaluepairs operator path photoshop picturebox pixelinversion post powerpacks programming property radians regex remote remoting resource restore richtextbox server sleep socket sql statistics stream string table text textbox thread time timer update usercontrol validation visualstudio wait webbrowser windows winforms working wpf xml






