Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2006, 05:49 AM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default encrypting and decrypting money field in c#

can any one help me in encrypting & decrypting my database using c#

In my database i hv a field name Money its data type is money.
I want to encrypt this field while records are inserted.
I am able to encrypt all the text fields except this.
I am using asp.net c# with sql server 2000.
 
Old August 7th, 2006, 12:31 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

what do you mean by encrypting money filed. Please explain

Regards
Ganesh
http://ganeshprof.blogspot.com
 
Old August 7th, 2006, 02:57 AM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by r_ganesh76
 what do you mean by encrypting money filed. Please explain

Regards
Ganesh
http://ganeshprof.blogspot.com
in my database i hv a field name Money whoes data type is money.
I want to encrypt this field while records are inserted.
I am able to encrypt all the text fields except this.
I am using asp.net c# with sql server 2000.

 
Old August 8th, 2006, 07:12 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I am going to assume that when you take the value, say $120.58, and encrypt it to a string (MD5, SHA, RSA, Base64, etc) SQL is probably telling you something like this:

"String value [encrypted string] cannot be inserted into column money of type money; Insert fails."

What you will have to do is change your column type from Money to Nvarchar to store that information because, at the point you encrypt the information, it is no longer "money" it is an encrypted string.

Hth.

"The one language all programmers understand is profanity."





Similar Threads
Thread Thread Starter Forum Replies Last Post
Decrypting pgp files with vbscript tonyromero99 VBScript 4 June 4th, 2008 04:09 AM
Bad data when decrypting using RSA scotthcw ASP.NET 2.0 Basics 0 December 8th, 2006 11:10 PM
DECRYPTING Data? Thagi ASP.NET 1.x and 2.0 Application Design 1 March 28th, 2006 05:46 PM
problem decrypting bluelaser General .NET 0 October 10th, 2004 10:18 AM
Encrypting and Decrypting chipset VB How-To 0 July 27th, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.