|
This Undo/Redo should function only when the database I "open" ( I mean when someone is using it). When the application is closed , all the data that take care of tis function should be deleted , and when the application is open again the story start from beginning.
( I say I want to mimic Word , so as long as the document is open , can be Undo/Redo step by step , when the document is closed , and re-opened , the olds Undo/Redo are lost.)
|
|
|
|
|
Hello !
I'm using entity framework.
I have a bindingsource bound to entity.
First when I fill the bindingsource I use this :
Bindingsource.Datasource=(From t in context.MyTable1 where t.vl>5 select t).Tolist
Now , let's suppose that for some of the bindingsource's items the vl's value is change to a value lower than 5.
How can I refresh my bindingsource in order to be correct with the condition specified on my first expression ( t.vl>5). In other words how to remove these items with vl<5 from the bindingsource ( but of course without deleting them from datasource , and without querying the database again).
Thank you !
|
|
|
|
|
The way you've bound your data, you have no choice but to execute the query again.
Instead of doing the filtering in the query (your where clause) let the query return all the records instead and let the UI control displaying your data handle the filtering, if it supports doing such a thing. You don't tell us anything about your display control so it's impossible to say.
|
|
|
|
|
I found the Bindingsource.RemoveAt or BindingSource.Removecurrent.
If I use these commands , the item is removed from bindingsource .
But my question is : If after I call context.savechanges , these items will be removed from database too ?
If no , then I've found the solution.
|
|
|
|
|
Your first post made it sound like you were trying to remove these items from the grid by filtering.
Now you're talking about updating the database, removing these items from the database?
Which is it?
In order for items to be deleted, you have to retrieve the items to be deleted from the database so they are being tracked by Entity Framework. You then, in Entity Frameworks object tracker, tag those objects to be deleted, one by one. Then you can call SaveChanges() and they will be deleted from the database.
You seriously need to pickup a book on Entity Framework and work through it. You're asking a bunch of questions that would have been answered already had you gone through the book.
|
|
|
|
|
My question is simple :
On a bindingsource , the methods Removeat and RemoveCurrent , only remove the items from the bindingsource , or mark them for deletions even from database ?
|
|
|
|
|
It affects only the data bound to the binding source. In your case, that would be a List<> of objects.
What you're doing will not affect the database at all.
|
|
|
|
|
The application has about 30 forms, some forms have menubars.
All forms and controls are singleton pattern.
I want to search all controls in the application to find a control instance with the specific string name, like, "MenuLogin".
I tried Me.Controls, but it only contain the controls of the current form.
Thanks
|
|
|
|
|
You'll have to keep a collection of all Forms in the application, then implement a method on each Form that searches that Form for the control you want.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Assuming the forms you want to search are currently open, then you can use the Application.OpenForms collection[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Some are opened, some are not
|
|
|
|
|
I'm not quiet sure if I understood the question in the right way.
I suggest :
You iterate through the Application.OpenForms-collection to get the Forms of your Project.
This collection return you a Form. Inside each Form you iterate through the Form.Controls-collection and look for your control.
modified 23-Jun-15 4:40am.
|
|
|
|
|
How can i use freeze Pane for first row in excel by vb.net using EPPlus.dll for excel.
|
|
|
|
|
From the ExcelWorksheet object, access the View property. On the returned ExcelWorksheetView object, call the FreezePanes(row, column) method, passing in the row and column of the first cell which is not frozen.
For example, to freeze the first row, you would need to pass in 2 to the row parameter:
sheet.View.FreezePanes(2, 1)
One of the samples on the site demonstrates this:
https://epplus.codeplex.com/SourceControl/latest#SampleApp/Sample6.cs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks it's work
|
|
|
|
|
how i can get data to text box and i replace to my list view like transaction on POS thanks pleasehelp us
|
|
|
|
|
Not a good question at all.
We have no idea what you mean by "get data to textbox". It could be as simple as MyTextBox.Text = "something" but we have no idea what your actual problem is.
As for the rest of your "question", it doesn't make any sense at all. More detail is going to be needed to figure out what you're trying to do.
|
|
|
|
|
Currently I'm using VB6 and Crystal Report 10 as my report Designer.
I can connect VB6 and Crystal report and view the report from access database.
My challenge is, I want to filter the report and view a specific data, for example, I want to view Employees that were employed between a specified date range (eg between 01/03/2014 - 31/12/2014)
And also a specific employee (by Name) Date of employment
from access database.
How can I do this ....?
Please Help.
|
|
|
|
|
You need to apply a filter to the Crystal Report - this book chapter[^] will point you in the right direction
|
|
|
|
|
Hello !
From vb.net , how can I detect if a database with a specific name exist or no in SQL server ?
Thank you !
|
|
|
|
|
SELECT * FROM sys.databases
|
|
|
|
|
Hi
I am relatively quite new to programming.
I am working in my job with configuration of applications which are database driven (oracle)
THere are times where we need to automate the excel reports etc from the database. There i need to understand how to code automate the excel reports using visual basic.
Can someone recommed a good book which covers everything to advanced.
REgads
|
|
|
|
|
Don't know why someone down voted this question, countered!
What you need is VSTO, visual studio for office, this search [^] may help with resources.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello !
In a vb.net project , I have a lot's of images that are imported into Project Resources.
Thinking that these may increase the size of the exe file , is there any possibility to move in a separate file outside the main .exe ?? ( Or I'm wrong with this idea ?)
Thank you !
|
|
|
|
|
If you are going to separate them from your executable, I'd recommend to put them into a resource-file, in a separate assembly.
The end-result would be the same as when you added them to the executable, with the minor diffrence of the overhead of an extra assembly. You'd need to load the thing to access the resources. If they are application-resources that are often used, then they'd be needed anyway. The size won't change, whether they are in a separate file or in the executable.
I do recommend using resource-files; and do use the generated and type-safe access that visual studio provides. Not only does it structure resources, it also makes internationalization easier, since your resources can vary by culture, defaulting to, well, the default culture of your design.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|