|
Yes pupil.
|
|
|
|
|
We've been telling you how to resolve the problem, over and over again. YOU refuse to listen to it because it doesn't fit what you envision.
Moving records to a second database is bullshit. It overcomplicates things greatly. That correct solution is to tag the records deleted but never execute a hard delete on them. That way it's really very easy to "undelete" them. You just change the delete flag on the record.
No scripts as this adds even more complexity and incompatibility when you change the database schema.
But hey, if you want to support this pain in the ass method you want to implement, and trust me, you WILL regret doing this, go right ahead.
I'm done here and on every other question you ever ask.
|
|
|
|
|
Quote: We've been telling you how to resolve the problem, over and over again. YOU refuse to listen to it because it doesn't fit what you envision.
Moving records to a second database is bullsh*t. It overcomplicates things greatly. That correct solution is to tag the records deleted but never execute a hard delete on them. That way it's really very easy to "undelete" them. You just change the delete flag on the record.
And I have confirmed that I have used your idea only for the "soft delete" level. for hard delete level this has no sense.Because I will keep on my database a lot's of records that probably for the most of them I never need again.
For this I'm trying to find a way for Hard delete - Recover.
For this , everyone says that it can be implemented but it's not a good thing to implement.
Well , regardless if a bad idea , just show the idea.
Quote: I'm done here and on every other question you ever ask.
Whatever you want , nobody is forced to answer a question whatever the reason he may have ( Doesn't want , doesn't know , want to look that he know but he doesn't know , it's difficult and he has no time to loose ......)
And , of course to show the power , instead of response , it's better a down vote
|
|
|
|
|
As others have said, the best way to handle the delete with Entity framework is to have a soft-delete column. Now, if your requirement to manage hard deletes is an absolute must, then you are going to have to get down and dirty at the database itself - there is no way you can manage this via Entity Framework because, apart from anything else, the hard delete might just happen with the user typing DELETE.... directly against the database.
Given the fact that you now know that you will need to do this at the database level, this suggests that the mechanism might well have to be something that can react to a SQL command at the database. This would indicate, to me at least, that the mechanism that you are looking for is to use a delete trigger (actually, you're going to want to build up a lot of triggers). Now, a trigger is an atomic operation that only acts on one table so you're going to have to be clever with the way you build your trigger "scaffolding" so that you can recreate disparate statements. There's no real fool-proof way of guaranteeing that you can recreate the records because the user can do things in a way that prevents this, but you could make a best-effort that helps achieve this.
|
|
|
|
|
Thank you !
I need to do this via Entity Framework.
So keeping another database where I put "hard deleted" records it seems a possible solution.
The only problem is that I can't keep the relationships for the reasons I've described above , so I'm testing a way to keep another database identical but without relationships. The problem that I have to resolve is when a user need to restore a deleted record , how can I know which is the parent of this record and which are its childs.
|
|
|
|
|
The "easiest" way is probably to change database and use Oracle Flashback[^] technology.
So, changing database is neither fun nor easy, but your other options are to use soft deletes, as has already been suggested by more experienced developers than me, or implementing your own solution.
Probably involving lots of triggers and transaction tables and I do not recommend it.
|
|
|
|
|
Have you any idea if this Oracle FlashBack is supported by Entity Framework ?
modified 29-Jun-15 21:25pm.
|
|
|
|
|
No.
But if you consider that EF is a Microsoft technology I strongly doubt that.
|
|
|
|
|
I don't know Oracle FlashBack , but according to this article , Oracle support entity Framework : http://www.oracle.com/technetwork/issue-archive/2011/11-sep/o51odt-453447.html[^]
But anyway , what is different oracle from sql server according to my problem ?
I need to do this recovery process in Entity Framework level , ( so not directly to SQL server or Oracle ) because I must test first if the record being recovered can or cannot recover according to program tests and actual conditions.
|
|
|
|
|
Oracle supporting Entity Framework does not mean that Entity Framework supports Oracle Flashback.
|
|
|
|
|
I have two hash table
1) LogoCount
key Value
item1-> 123
item2-> 10
item3-> 45
2)LogoGroupCount
key Value
item1-> item2,item3,item1
item5-> item5,item1
item2-> item2
I want to join this two hashtabel using linq in vb.net and answer will be
1)Result:
key value
item1-> item1
item5-> item1
item2-> item2
because item1 has max count if that not exist in hashtable 1 than it will get default 0
so how can i do ?
|
|
|
|
|
Please don't cross-post the same question across this site - choose whether you want to keep this question here or use How Do I Join 2 Hash Table In Linq With Vb.Net ?[^] and then delete the other.
Either way - I've asked what you have tried - it might help to clarify what you are trying to do.
|
|
|
|
|
For Each logo In htLogoGroupCount
Dim Count(logo.Value.Count - 1) As Integer
For i As Integer = 0 To logo.Value.Count - 1
Dim sOptLogo() As String = logo.Value(i).Split(":")
Count(i) = sOptLogo(1)
Next
Dim MaxCount As Integer = Array.IndexOf(Count, Count.Max())
Dim sLogoValue As String = logo.Value(MaxCount).ToString
Dim sOptLogoName() As String = sLogoValue.Split(":")
alstOptimize.Add(sOptLogoName(0))
Next
I will assign value to count by adding ":" symbol in htLogoGroupCount in value from htLogoCount and then try above code but i will do it by Linq.
|
|
|
|
|
I don't want to copy entire row how do I do this ..
This is a copy of the macro I want to amend
Private Sub Workbook_Open()
Dim i, Lastrow
Lastrow = Sheets("Master").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Personel").Range("A2:N10000").ClearContents
For i = 2 To Lastrow
If Sheets("Master").Cells(i, "B").Value = "Personel Abby" Then
Sheets("Master").Cells(i, "B").EntireRow.Copy Destination:=Sheets("Personel").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next i
|
|
|
|
|
Delete "EntireRow" or use it with the right Selector ...
|
|
|
|
|
I am designing a accounting system application prototype,and need some help on how to build Chart of Accounts using VB 2010
|
|
|
|
|
You should probably try defining what you mean by a chart of accounts and what you expect to be able to do with this wonderful creation.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Chart of Accounts is a list of hierarchical accounting system which is designed as per the generally accepted accounting principles
|
|
|
|
|
You need a database (or other storage system) to persist you data.
Account Table
Link table to form your hierarchical structure
You then need a user interface so the user can perform CRUD operations on the tables. Simples!!!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Uhhhh no. We know what an account of charts is supposed to BE. The questions you need to answer to yourself is describing in detail exactly what data you need, how you're going to get it, and how your going to present that data to the user. Without that description you have no target to code for.
You haven't done that.
|
|
|
|
|
Hello !
I have working before on a vb.net application with MS Access Database. On my application I had a Function "Compact_And_repair" that is called every time the application is closed. This function will compact and repair the Ms Access database file.( After this function is called , the database size is decreased)
Now I'm creating an application that use a Sql server database. I'm asking if I can do similar action to a SQl server database .
If yes , which are the instruction to do this from inside my vb.net application ?
Thank you !
|
|
|
|
|
Since you post multiple questions, you are well aware of the general rules of asking questions and what many of the repsonses will be.
So, this should have been done already, but it is hasn't.
1. Search for a solution yourself
2. If you find a solution and have a SPECIFIC issue implementing it, ask for help.
3. Do not ask someone to give you the entire solution.
|
|
|
|
|
There is no such concept in SQL Server. It applies ONLY to Access databases.
|
|
|
|
|
"Don't" for server-databases; size is less of an issue than speed. It is also of no concern to the application using the database, it is a concern for the database-admin, the owner of the server.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have noticed , that my database size continue to increase , and even when I delete records the size is not decreased.
Is this a problem ? And if yes , what I can do from inside of my application ?
|
|
|
|