|
waner michaud wrote: Visual Studio 2005 and Sql Express
SQL Express cannot serve as a Publisher or Distributer, only as a Subscriber[^]. There's also the Microsoft Sync Framework to consider, but I couldn't find much examples on Sql Express[^].
The alternative would be to synchronize the data manually. There's a CodeProject article here[^] that explains how this could be done.
I are Troll
|
|
|
|
|
Hi,
thanks again for the information you provided me..
Ok.for my purpose I only need to work with one table..
one table from the source and one table to destination..
destination table has no foreign key constraint..
OfficerTable on the destination database is solely there for searching..
I can do basecally anything on it such(del, alter, modify and so forth) since no constraint..
I think using a stored procedure will be ideal situation in my case..
The article is bit convoluted, with my very litle experience in sp..
can you lead me a bit so I don't get lost in a carbweb.. I do not like to waste valuable in something I am not good at..
Briefly, my cenario is as such, Open a connection, select OfficerTable from the source, send it to destination database which was the original point of initiating the connection to modify OfficerTable in destination.
Once again, I thank you..
|
|
|
|
|
waner michaud wrote: The article is bit convoluted, with my very litle experience in sp..
No worries, experience comes from doing
waner michaud wrote: I do not like to waste valuable in something I am not good at..
If the client wants it, then somebody has to build it. Building yields experience and valuable knowledge.
waner michaud wrote: Briefly, my cenario is as such, Open a connection, select OfficerTable from the source, send it to destination database which was the original point of initiating the connection to modify OfficerTable in destination.
Let's make three scenario's out of that;
0) Records to be deleted from Destination database table
1) Records to be inserted into Destination database table
2) Records to be updated in the Destination database table
The link to the CodeProject[^]-article contains example sourcecode on performing those three steps using stored procedures.
I are Troll
|
|
|
|
|
Hi,
Must I create a sp for delete, insert, and update that reside in the database for the destination table and as well in the source database?
Thanks
|
|
|
|
|
waner michaud wrote: Must I create a sp for delete, insert, and update that reside in the database for the destination table and as well in the source database?
According to the article, you'd only have to create stored procedures for the destination database
I are Troll
|
|
|
|
|
Hi,
Ok. since I need the destination table for search only. Can I just simply alter the destiantion table?
thanks..
|
|
|
|
|
waner michaud wrote: Ok. since I need the destination table for search only. Can I just simply alter the destiantion table?
Would it be OK to overwrite the destination-table with the source-data? If that's the case, then DROP the destination table and do a SELECT INTO . That would create a new table, based on the data that the query returns.
If you want readonly remote access to a table in a different database from the same server, then a view could be another alternative;
CREATE VIEW [destinationDb].[dbo].[RemoteOrders]
AS
SELECT *
FROM [sourceDb].[dbo].[Orders]
I are Troll
|
|
|
|
|
hi,
I am getting the concept of stored procedure a bit..I am going to create a sp to do DROP AND INSERT INTO.
which the following Should I do?
I am using dataset.
I will have a Connect_to_HNP_button. Once I establish a connection, I want to show all the tables. Select OfficerProfile_table, and then call the sp to import table.
Or on the Connect_to_HNP_button_click event call the stored procedure. Inside the sp, establish the connection, and then do DROP DESTINATION OfficerProfile_table, and INSERT INTO DESTINATION OfficerProfile_table FROM THE SOURCE..
Which way to go and how?
Thanks
|
|
|
|
|
waner michaud wrote: Which way to go and how?
The second option: create a form, drop a button on it, and make it call a stored procedure. Create a table and see if you can drop it from code
I are Troll
|
|
|
|
|
Hi,
Ok..I'll keep you posted..
Thanks
|
|
|
|
|
hey experts
when i deploy my application on user system after that if i copy the installed application from program files and paste it on another system it runs without running setup. i want to make my application secure. how can i do this, waiting for help
i also want to use trial version and full version facility.
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
Hi NarendraSinghJTV,
to make secure your Windows application you can use Windows registry editor. Code your application to check some values in registry to check whether the application is installed or cop-paste.
You can also use some temp files for the same.
For trial and full version application, you need to keep installed date of application in a secure file and check everytime current date when the application is launched. If current date is more then trial time then it should ask to enter key or something like that.
I hope you got what you wanted!
Gagan
|
|
|
|
|
hey gagan
i have cleared my first problem with the help of registry , but can u please tell me how to work with secure files in c#. i dont know about secure files. it will be very helpful for me
thanks for replay
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
A secret file is nothing but an ordinary file in encrypted format. Use any encryption-decryption algorithm to make a file secure. The same algorithm can be used to store and retieve values in registry so that it can't be read or modified by the user.
|
|
|
|
|
Registry and/or secret file as pointed out by the previous post are good enough for normal use. People can always find the registry key or the secret file and modify it. They can also turn back time briefly to run a trial version of the program if it is setup that way.
To be more secure, you need to gather information about the machine that the setup program had run on, and encrypt it, then save it to the registry. Each time the program is run, it gathers the same information, encrypt it using the same algorithm, and compare the result in the registry. One of these things will happen:
1. The information in the registry is the same as the newly encrypted information. The program can preceed.
2. The information in the registry is different as the newly encrypted information, indicating that the registry was messed with by somebody, or it's a different machine. The program will terminate.
3. The information in the registry is not found. The program will terminate.
The information collected can include things like the MAC address of the NIC, as well as other ID's that are different from machine to machine.
There is a risk that people can install your program on multiple machines, and read the registry to find out what algorighm you used to encrypt the information. They have also to try to find out what information is collected. That take a good effort. Hopefully that will intimidate them off.
For the implementation of a trial version of your program you need to implement similar algorithms but rely on other resources for time, such as that from the Internet. You can also put checks on time consistancy so if you find that the time is messed with, the program simply terminates.
Once any of the above checks fails, the program should put a mark down (also encrypted) so later runs of the program, even though it may pass the checks, will not authorize a "go". The program will be dead.
|
|
|
|
|
hey
thanks for great reply
can u please point out some example to make me easy to work with those conditions, it will be very helpful for me
Regards
Narendra Singh
(Jindal Tech Ventures)
|
|
|
|
|
Hi All
Can anyone suggest me an idea for reading .dxf file
Regards
Gany
|
|
|
|
|
DXF file is as per the following http://en.wikipedia.org/wiki/AutoCAD_DXF[^]
You will either need to find a free viewer or library to use these files...or if you have a lot of time to spare, write your own.
|
|
|
|
|
Hi all...
I want to create a simple program which takes a file and compute its hash value, also it will check whether the file is corrupt or damaged or not.
I googled a lot but I did not get any code for that error detection.
If you have any piece of code then suggest me..
Thanks.
Gagan
|
|
|
|
|
If you generate a hash value when the file is generated. and then re-check the hash at a later date, you will know that the file is still the same and not-corrupted if the hash value doesn't change.
Do a search for MD5, SHA1, SHA256 etc.
|
|
|
|
|
Hi,
I have some high-performance C# code that reads any file and calculates a CRC32 for it; it is table-driven to get maximum speed. There is an infinite number of definitions for checksums, hashes and the like, however my code returns the same value that is reported by ZIP utilities such as WinZip.
If you're inexperienced in bit fiddling, you may have some trouble in translating it to another language, especially VB/VB.NET; not sure the automatic translators such as this one[^] would do a good job here.
Interested?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Thanks for your reply,,,
Could you gimmie some piece of code in C#. Is it possible to judge whether the file is damaged or not by computed hash value??
Thanks.
Gagan
|
|
|
|
|
to check for "damage" you need to:
1. have a file
2. calculate some kind of checksum
3. wait
4. calculate the checksum again in an identical way
5. if the results of (2) and (4) don't match, you can be sure the file was modified during (3); if they match, that most likely means the file was not modified.
FWIW: If, between (2) and (4) the file gets transfered to another machine, so (4) is not running where (2) was running, then you also need to transfer the checksum somehow; someone intending to fiddle with your file could also do so to whatever you choose for transferring the checksum
The code I have only calculates the checksum, it does not check anything, nor does it have a GUI.
It has two methods, the first is simply reading all the data reusing the same buffer over and over
(pseudocode shown), the second is "adding" the data to the ongoing CRC.
private static uint[] CRCtable={
0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c};
public static uint CalcCRC(string fileName) {
uint CRC=0;
open the file
byte[] buf=new byte[0x10000];
for(;;) {
int count=readBinaryDataFromFileReturningCount(file, buf);
if (count<=0) break;
CRC=updateCRC(CRC,buf,count);
}
close the file
return CRC;
}
private static uint updateCRC(uint CRC, byte[] buf, int count) {
CRC=~CRC;
for (int i=0; i< count; i++) {
byte chr=buf[i];
uint index=(CRC^chr)&0x0F;
CRC=(CRC>>4)^CRCtable[index];
chr>>=4;
index=(CRC^chr)&0x0F;
CRC=(CRC>>4)^CRCtable[index];
}
return ~CRC;
}
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
modified on Friday, January 22, 2010 12:44 PM
|
|
|
|
|
Are you sure a file will have two different hash values after sometime if it is damaged or corrupted??
|
|
|
|
|
No.
I said "if the results of (2) and (4) don't match, you can be sure the file was modified during (3); if they match, that most likely means the file was not modified." and nothing else.
There isn't a checksum, hash or anything in the world that will assure this.
The larger the checksum range (i.e. the more bits it uses), the lower the probability of a false match.
If you need to be absolutely sure, you need a check that has at least the same number of bits as the [ADDED] optimal loss-less compressed version of [/ADDED] the actual file itself.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
modified on Friday, January 22, 2010 12:56 PM
|
|
|
|
|