|
It really depends on what changes you want to make, and when you want to make those changes. You could do this with triggers, but that would mean modifying the 3rd party database, and you could have issues if you change the schema of the 3rd party database (say during an update). Also, some 3rd parties will have warranty/support clauses that would be invalidated by you altering their schema - we do, for instance, because of a particularly troublesome client who broke the database and then expected us to bail them out at our expense.
If you are just looking to replicate the data, and the change doesn't need to be instantaneous, you could use something like the Sync Framework[^] to accomplish this.
BTW - this isn't a C# question. It belongs in the database forum.
|
|
|
|
|
Thanks Pete. Unfortunately the changes do need to be instantaneous and we need to manipulate the data before putting it into our database. Luckily we are able/allowed to change the 3rd party DB schema, but obviously have to bear updates in mind like you say.
Apologies for posting in wrong forum, you're completely right. May be I was subconsciously hoping for a C# solution!
|
|
|
|
|
Then triggers are your best choice - don't forget to take into account the fact that the database you are trying to copy into might be down, so your solution will have to cope with this.
|
|
|
|
|
If the change involves transformation of data, you might use a combination of Triggers and Procedures, otherwise Replication[^] will be the right choice.
modified 26-Sep-12 10:26am.
|
|
|
|
|
With Visual Studio 2012, setup projects will no more be available.
Setups have aways been a pita with Visual Studio, but after a first glance, WiX feels even more painful. InstallShield LE is said to not support Windows Services...
What will you do then - use free WiX, or buy a commercial tool (which one)?
|
|
|
|
|
Well...this article[^] provide a point of view to why setup was removed.
I guess WIX is the future (as per the author of the blog).
|
|
|
|
|
|
Thanks for the link. I've just added this to the Free Tools forum here on Code Project. My 5.
|
|
|
|
|
|
Looks interesting. I'll give it a try.
|
|
|
|
|
I've been very happy with Advanced Installer[^]. I use the free version for my freeware apps.
/ravi
|
|
|
|
|
That's a good tool. We need Custom Actions, and additionally the Dialog Editor - consequently, it costs just a thousand dollars per developer ("Enterprise" version)...
At least, I could create such an advanced install project within a few hours, quite easily.
|
|
|
|
|
how to find a menu item name by passing menu text in a mdi form ?
|
|
|
|
|
anushikaroshan wrote: how to find a menu item name by passing menu text
Enumerate the ContextMenuStrip Items and take a look the items[nr].Text or use cms.Items.Find(key, true) to get all Items corresonding the name.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
What is the best way to encrypt the connection string in web config file?
|
|
|
|
|
I'd use the inbuilt .NET functionality to accomplish it. You can find info here[^].
|
|
|
|
|
Sorry if this posted more than once.
I have a method that creates this value:
0x0001000000FFFFFFFF01000000000000000601000000036162630B
It is stored in the DB as <Binary Data>.
I use Select value from table where id = 1234.
This is the code that writes creates the value:
<pre>
public void SetSessionData(string token, object data)
{
DataService ds = null;
try
{
ds = new DataService();
using (MemoryStream stream = new MemoryStream())
{
DALArgs args = new DALArgs();
ds.SetRealmConnection(_realm);
Args.Add("sessionkey", _sessionkey);
args.Add("sessiontoken", token);
BinaryFormatter b = new BinaryFormatter();
b.Serialize(stream, data);
stream.Position = 0;
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
args.Add("sessionvalue", buffer);
ds.Execute("olb_SetSessionData", args);
</pre>
I'm trying to figure out how I can assign the results of the select statement to a variable and create this response:
0
1
0
0
0
255
255
255
255
1
0
0
0
0
0
0
0
6
1
0
0
0
3
97
98
99
That array comes from this:
<pre>
if (reader.Read())
{
byte[] data = (byte[])reader["SessionValue"];
<pre/>
I hope that is enough information, and that it can be done.
Any help is appreciated.
Sign In·View Thread·Permalink
|
|
|
|
|
Member 9283122 wrote: Sorry if this posted more than once.
That'd be accepted if it were accidental; however, you copied/pasted your complete question, bumping your request. That's not done - your question is not more important than the others.
Most of the examples on serializing come with an example on deserializing. And mostly, it is separated from the rest of the logic; meaning that you serialize/deserialize an object, without a reference to a database.
Can you please edit the question and include your serialization routine? Your deserialization-code will be based on that.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
This is the seralization code:
BinaryFormatter b = new BinaryFormatter();
b.Serialize(stream, data);
stream.Position = 0;
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
|
|
|
|
|
mp = null;
stream = File.Open("EmployeeInfo.osl", FileMode.Open);
bformatter = new BinaryFormatter();
Console.WriteLine("Reading Employee Information");
mp = (Employee)bformatter.Deserialize(stream);
stream.Close();
Console.WriteLine("Employee Id: {0}",mp.EmpId.ToString());
Console.WriteLine("Employee Name: {0}",mp.EmpName); Taken from this[^] article, your code would look something like below;
BinaryFormatter b = new BinaryFormatter();
using (Stream s = File.Open("EmployeeInfo.osl", FileMode.Open))
{
return (MyType)b.Deserialize(s);
}
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks Eddy, I'll give that a try.
|
|
|
|
|
You're welcome.
I'd try it in a separate console-app, and move it to the "current" app that your working on once it works. It helps to keep the samples as small as possible, making sure that none of the other code interferes. Once you're used to that, it's a small step to writing (unit) tests.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Don't you see that the value you presented is just 0x followed by the hexadecimal representation of each of the numbersou listed followed by 0b?
|
|
|
|
|
Thanks for the response Bernhard. How does FF translate to 255?
|
|
|
|
|
Hexadecimal - you have "digits" from 0 to 15, 10 becomes "A".
So to translate back, "F" means 15, "FF" is just 15*16 + 15.
|
|
|
|