|
I am uploading entities from one database to an identical one via a web service. The problem is that there are multiple copies of the database on multiple clients and this causes key collisions since we are using identity fields. For example, two identical tables will both have a key of "1". I am stuck with this schema, I'm afraid, so creating composite keys that would include an uploadclient key is not an option.
The central db is the same as the client databases, and is just intended to store all of the data from the upload clients.
I am writing LOTS of code that basically takes in an uploaded entity and creates a new one, then copies all of the properties into a new object before saving that new one to the database. This appears to be the only way to insert them with new keys since I can't use the key value of the uploaded object.
Given the constraints, does this sound like the best option? It's working fine, it is just a lot of code to type and I thought I would get some different views before I commit too much time to this.
|
|
|
|
|
How about creating an identity column(autogenerated unique Id) in the destination table?
|
|
|
|
|
Is making GUID primary keys an option ? There would be very few chances that the same key is being generated on several clients.
You could also have a look at Sync Framework. But this requires a little extra searches and experiments.
Hope this helps.
No memory stick has been harmed during establishment of this signature.
|
|
|
|
|
Thank you for the link, I'll be investigating that one.
I argued long and loud to have the guid keys, but in the end it wasn't my call. I afraid it came across as, "I'm too lazy to do lots of typing so let's add guids!"
Well long story short, I'm adding the entities the "hard" way: receiving them in via my WCF service and newing them up (along with tons of intersect table-relations) and then saving them to the central database.
It somewhat breaks the audit trail because you can't compare the client machine's data to the central database by a unique key, but admittedly you can find them by looking at the datetime stamps and some other key columns if the need to audit/reconcile arises.
|
|
|
|
|
Hi All:
How can I create Docking Control in c#?
modified 25-Nov-11 10:00am.
|
|
|
|
|
Well, what's it supposed to do?
|
|
|
|
|
I want to Create an Control as an Docking Control
I want to Create like ToolBox Control that can resize and Docking
|
|
|
|
|
Well, there's several ways Docking is done in various applications ranging from Visual Studio to PhotoShop, to whatever.
There are third party control libraries for .NET that implement docking containers in various ways.
The key question: how do you want to implement docking: describe the UI you wish to see in detail. Are you talking about "auto-snap" features where a visual object near the boundaries of another (whether inside or outside the "other" object) through some direct action align themselves with the edges of the "other object" ?
Are you talking about, when docking begins, certain special UI visual features that control the target docking site appear, as in Visual Studio ?
best, Bill
Scipio: "That's true, Berganza; and what makes the miracle greater is, that we not only speak, but hold intelligent discourse, as though we had souls capable of reason; whereas we are so far from having it, that the difference between brutes and man consists in this, that man is a rational animal, and the brute is irrational." Cervantes, "Colloquy of Dogs," 1613CE. The two talking dogs, Scipio, Berganza, are hallucinations in the mind of a soldier with plague fever undergoing a "sweating" cure.
|
|
|
|
|
|
Yes,It is also a good idea for me too but I don't want to use the dll because It may be difficult edit when have the problem.So I hope you can give the exam project that can create an docking Control..... waiting to hearing from you....Thank in advance
|
|
|
|
|
kornkimhour wrote in response to JF2015: "I hope you can give the exam project that can create an docking Control"
If you don't conceive and execute your own exam project, how do you think you are ever going to develop yourself as a programmer, get work as a programmer in the future ?
JF2015 kindly directed to you a CodeProject docking implementation whose source-code is open for you to read, study, copy, modify.
What more could you ask for than that ?
Lift a finger, and get to work.
Scipio: "That's true, Berganza; and what makes the miracle greater is, that we not only speak, but hold intelligent discourse, as though we had souls capable of reason; whereas we are so far from having it, that the difference between brutes and man consists in this, that man is a rational animal, and the brute is irrational." Cervantes, "Colloquy of Dogs," 1613CE. The two talking dogs, Scipio, Berganza, are hallucinations in the mind of a soldier with plague fever undergoing a "sweating" cure.
|
|
|
|
|
sorry I write it wrong....I want to write an example project,but I write Exam Project... Thank for telling me about this wrong command....so I really happy when hearing from your reply....I hope all programmer can give me more about an idea that connect to my misunderstand......
|
|
|
|
|
Hi All !
in a DataGridView , for example :
DataGridView1[0,0].Value=1.2*3;
Result is : 3.6
But if :
DataGridView1[0,0].Value=2/3
Result is : 0
plz help , how can I show a floating value by Dividing Two Number in a cell of DataGridView
Thanks
|
|
|
|
|
The result is 0 because you are dividing an integer by an integer, which leads the compiler to treat the result as an integer. The trick is to cast the first number to a double and then base the calculation on this.
|
|
|
|
|
Yes , It's a Big Mistake for Me !
Thanks !
|
|
|
|
|
by writing it 2/3 the compiler thinks you are doing integer division. You should explicitly denote one of the inputs as a float by using the f symbol:-
DataGridView1[0,0].Value=2f/3;
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thanks!
|
|
|
|
|
Wayne Gaylard wrote: by writing it 2/3 the compiler thinks you are doing integer division
FTFY
|
|
|
|
|
I was giving him(OP) the benefit of the doubt
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
That is Modular division.
if it is like 4/3 ans will be 1.
U can get the ans if u make it like 2.0/3 or 2/3.0
|
|
|
|
|
Hello!
I want to design a complex text editor that will be capable to design, fill and print necessary marketing papers according to the law.
The negative side - i do not know how to make it happen, which classes or libraries can help me to do it? (Speaking plain, make something as powerful as MsWord when it comes to designin a document)
OR: How can i export the designed document template from Microsoft Word to an application, where i will fill it with data (from
Postgres 9.1) and print it?
Thank you.
|
|
|
|
|
Aleonis wrote: I want to design a complex text editor
Aleonis wrote: i do not know how to make it happen
As they say in the Emerald Isle: "You don't want to start from here!".
The first thing you need to do is spend some time with some of the C# tutorials, paying particular attention to classes and how they can be used. There are some good tutorials here[^], and lots of CodeProject articles[^] to help you. Next you perhaps need to learn about how to access Microsoft Word documents using the Interop assemblies[^]. Once you have mastered these areas you can probably move on to the design phase of your editor.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Well i`m not a beginner in C#, it is my first application with such demand. I`ve built a lot of apps using classes on C+ and some on C#.
Thank you for showing me the right way, looks like i better master Interlop assemblies head on...
|
|
|
|
|
Aleonis wrote: Well i`m not a beginner
My apologies but your original message implied that you may have been.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Yes, it looks like my own fault Thank you again.
|
|
|
|