I use entity framework core and bulk extensions library, and problem is that if I bind data to win forms datagridview using context.Local.ToBindingList, it not updates it after I BulkInsert something.
I can bind data using context.Set<> and it updates, but if i do this, sorting in datagridview doesn't work. What I can do about it?
Related
When i bind database with my application using entity framework it show data on datagrid but when i do changes in database externally it does not reflect in datagrid.i need a code for which synchronize the database with my datagrid.so i can reflect any modification done in database then it will automatically update the datagrid.
Update you edmx file. When you modify DB you need to update your.edmx file.
Follow following link to update edmx.
How do you update an edmx file with database changes?
I made my winform application with C#, and i use entity framework 5. I use also MySql to my DB.
i like to have my DGV always updated and displa ythe "newest" data.
To use SqlDependency is the best way to update any control if there is a modification happened on DB's data?
Thank you to advice me?
I have successfully bound a SQLite database table to a DevExpress XtraGrid control, and can see the few test rows I have, and can also edit the values, and commit the changes back to the database with an Update command upon closing.
My question is what would be the best way for me to insert rows to the table? I have implemented and successfully used some example code for inserting rows into a SQLite table, however I am uncertain if the DevExpress XtraGrid has some type of method to allow me to skip all of the example code I have, and simply use the same functionality that seems to be already built into the control.
So should I use example code that connects to the database, builds the query then runs it on the database, or is there a better way, using something already built into the DevExpress WinForms suite?
Thanks.
You can use Embedded Navigator controls to insert rows !
https://www.devexpress.com/Support/Center/Question/Details/Q235790
After some research, I found that the best way to interact with the data in the grid, or with any database for that matter, is to use DevExpress's eXpress Persistent Objects for .NET. Great bit of technology. It allowed me to specify the database and table I was interested in, and it created all of the plumbing to allow me to deal with rows in the table like normal C# objects with properties.
If you are struggling with trying to mix in SQL queries and the like into your application, I highly recommend you make your life much easier and use XPO.
Here is a link to the documentation describing XPO: http://documentation.devexpress.com/#XPO/CustomDocument1998
How can I execute 1000s of INSERT queries using Enterprise Library DAAB? That is to say how can I insert lots of rows into a table using DAAB all at once efficiently? And without using a for-loop. Thanks.
Unfortunately, I'm not sure you can do that using the Enterprise Library DAAB without extending it. As an alternative you can use SqlBulkCopy.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx
EDIT
The Oracle Data Provider for .NET (ODP.NET) supports this via the Array Binding feature.
http://www.oracle.com/technetwork/issue-archive/2009/09-sep/o59odpnet-085168.html
I have a DataGridView using DataTable as my datasource. Now my problem is how do I keep my datatable synchronised to our server database? Like for example somebody tried to update the database so automatically my datatable will be updated too. Without using iteration. Is this possible?
There is nothing automatic in software. We need to automate things that seems to be automatic. You can use caching mechanism for your solution. The datatable can be filled using a cache. The cache can be made invalid on change of underlying tables in the database. And upon invalidating, the datatable shall have to be recreated again and so the gridview shall have to be updated.
If you are using ASP.NET, you can refer the MSDN article on the same here: http://msdn.microsoft.com/en-us/library/ms972379.aspx
Is this using WPF or Windows Forms?
Simple way: each client regularly polls the server and updates as needed.
More complex way: service oriented using callbacks, for example, http://www.switchonthecode.com/tutorials/wcf-tutorial-events-and-callbacks.