.NET 1.1 and .NET 2 Perceives DB data differently

I'm hoping someone can help me out - at least by pointing me to who I can ask, if not answering the question directly.

I have some encrypted values in a SQL Server 2000 database that I unencrypt and use in a website that I just converted from .NET 1.1 to .NET 2.

The data is pulled from the database using standard ADO with no changes between the .NET 1.1 version and the .NET 2 version - yet for some data entries, when the identical value is pulled by the .NET 2 code it is changed or shorted.

For example: 

1.1 code traces out a value pulled from the db as:

ᒪ࢖淨琳d搈把���媑쬹࡝䜻ꖉ���

The same value pulled from the database by .NET 2 looks like this:

ᒪ࢖淨琳d搈把媑쬹࡝䜻ꖉ

Do you know why the database value would be interpreted diferently by .NET 2 than by .NET 1.1? How can I bring this in sync so that both 1.1 sites and 2 sites can use the same data?

0
PaigePB
2/5/2007 8:42:35 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

8 Replies
888 Views

Similar Articles

[PageSpeed] 18

I do not know exactly but it is possible that if encrypt/decrypt on web ASP code it is possible that both version use different key to encrypt/decrypt data, You probably have to make your own key and do encryption/decryption on SQL server side which will always work the same way.

Thanks

 


Thanks

JPazgier
0
jpazgier
2/5/2007 11:11:07 PM

Thanks for answering!

 Both use the same key to decrypt. But what's interesting here is that the difference is evident before the decryption is run. The raw data from the database looks different (and is shorter) when pulled by ADO .NET 2 from when its pulled by ADO .NET 1.1.

0
PaigePB
2/6/2007 12:55:05 AM

Is it possible that one is returned as varchar and second nvarchar?

Thanks


Thanks

JPazgier
0
jpazgier
2/6/2007 1:21:09 AM

Now that's a thought. It would explain a shortening.

The column both are pulling from is an nvarchar... and the nvarchar/varchar distinction is not, as far as I know, found in  C# strings. So would ADO.NET 2 convert an nvarchar to a varchar while the exact same code in ADO.NET 1.1 does not?

How would I test to see if this is happening?

I think though that both items are returning nvarchar characters.. while its not visible in what I cut and pasted into this site, there were chinese- and greek-looking characters evident in both versions of the encrypted data which would seem to me like they were both coming out of the database as nvarchar.

0
PaigePB
2/6/2007 1:49:53 AM

Now that's a thought. It would explain a shortening.

The column both are pulling from is an nvarchar... and the nvarchar/varchar distinction is not, as far as I know, found in  C# strings. So would ADO.NET 2 convert an nvarchar to a varchar while the exact same code in ADO.NET 1.1 does not?

How would I test to see if this is happening?

I think though as a guess that both items are returning nvarchar characters.. while its not visible in what I cut and pasted into this site, there were chinese- and greek-looking characters evident in both versions of the encrypted data which would seem to me like they were both coming out of the database as nvarchar.

0
PaigePB
2/6/2007 1:50:07 AM

Now that's a thought. It would explain a shortening.

The column both are pulling from is an nvarchar... and the nvarchar/varchar distinction is not, as far as I know, found in  C# strings. So would ADO.NET 2 convert an nvarchar to a varchar while the exact same code in ADO.NET 1.1 does not?

How would I test to see if this is happening?

I think though as a guess that both items are returning nvarchar characters.. while its not visible in what I cut and pasted into this site, there were chinese- and greek-looking characters evident in both versions of the encrypted data which would seem to me like they were both coming out of the database as nvarchar.

0
PaigePB
2/6/2007 1:50:10 AM
oops... I think something just stuttered. :-)
0
PaigePB
2/6/2007 1:53:37 AM

I found out the answer... and it is NOT related to ADO.

Why I don't know why the encrypted data appeard differently in .NET 2 when debugged or traced out from the database, I did discover that the .NET 2 encryption has tightened what it will tolerate as acceptable unicode.  .NET 1.1 would allow UTF8 encoding... and if it didn't exactly match, it would allow a fudge estimate. .NET 2 does not allow that any more.  To get around this, rather than using typical encoding, one needs to make sure that 64 base encoding is used when creating string data from encrypted values.

 Information on this can be found here:

http://blogs.msdn.com/shawnfa/archive/2005/11/10/491431.aspx

 and here:

http://blogs.msdn.com/shawnste/archive/2005/03/24/401871.aspx

I needed to change my encryption code to use Convert.ToBase64String and Convert.FromBase64String rather than relying on the standard encoding classes. Once I did that, the .NET 2 code could encrypt and decrypt with consistancy with itself, but I could not maintain backwards compatability with the encrypted data already in the database - when it included the .NET 1.1 fudging.

0
PaigePB
2/7/2007 9:23:34 PM
Reply:

Similar Artilces:

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! Have a look into this links http://en.wikipedia.org/wiki/.NET_Framework http://blogs.msdn.com/mohammadakif/archive/2006/12/03/net-3-0-different-versions-of-the-net-framework.aspx http://www.codeproject.com/aspnet/ComparisonASP1xASP20.aspAshok Rajawww.iGold.inDon't forget to click "Mark as Answer" on the post that helped you. This credits that m...

Where is the ADO.NET Sybase driver for .NET 1.1 and .Net 2.0?
Hi All Does anyone know where I can get the Sybase drivers for ADO.NET for both versions, 1.1 and 2.0/3.0? Cheers Chris Burrell Hi Chris, There is no release of ASE ADO.NET Provider 2.0 (I assume you refer to ASE provider, not ASA - if ASA please port to sybase.public.sqlanywhere.general). For the 1.1 Provider: It is available in the ASE SDK for windows or the PC Client CDRom included with ASE product. On the SDK its available as 12.5.1 and 15.0 On ASE PC Client I think 12.5.1 is part of ASE 12.5.X and 15.0 is part of ASE 15.X 2.0 provider should release som...

.NET 1.1 conflicting with .NET 2
I have a new server Windows 2003, and one of the web apps it is hosting fails from time to time.  Checking the logs, the message talks about a conflict between .NET 1.1 and .NET 2.   It was my understanding that you could be running both ASP.NET 1 and ASP.NET 2 on the same box, with the pull-down selector to choose between them   Am I missing something here? thankscheersMatthewPerformance Outlook Each asp.net application runs in an Application Pool.Each Application Pool can only host one version of  ASP.NET at a time, so the first app to start sets the version...

.net 2.0 to .net 1.1
Hello , This is shrirang. Currently i am working .net2.0 web application. but the same application is runing on production in .net 1.1 freamwork . we are not using any new feature of 2.0 in our application . can i run build of 2.0 on 1.1 freamwork . if yes can you  please tell me necessary steps to achive it .     Thanks in advance for your kind help     Regards Shrirang i think it is not possible to run the 2.0 application in 1.1 , so try to change to the frame work in the production server . ThanksRaja Ragothaman Hi Shrirang, Please contact web adm...

having .net 1.1 and .net 2.0
Was just wondering if you someone could tell me the ramifications of the following:  I have .net 2.0 but did not uninstally .net 1.1, i have visual studio 2003, and visual web developer installed on the computer as well as sql server 2000.  my question is whether that is a problem having the two runtimes installed at the same time?  i did this because i wanted to use VWD but keep vs 2003 in case i needed to do any development for work....any comments are appreciated.  --jpIf my post is helpful please mark as answerRegards -- jp(http://www.rzrsolutions.com/rzrWeb20/...

.Net 2 and .Net 1.1 on same IIS
Hi - is there a step by step guide for this anywhere?(IIS6 - windows web server edition)I installed .net 2, and created a new virtual directory - uploaded my .net2 web files, and it didn't run.I changed the framework to .net2 in IIS, then I got server unavailable when trying to run my existing 1.1 apps.I setup a new application pool, and derived it from the DefaultPool already being used by .net1.1, and change my net 2 app to use the new application pool.When I tried to 'start' the site, it advised the port 80 was already in use by another web site.I think I know where to change port 80 - bu...

Post form with data to a external site (.net 1.1 vb.net) #2
Hi There I am programming a e-shop (.net 1.1) and what I want to achive is: Customer fill out form, clicks on the Pay button then should the following thing happen: Problem is that I need to do a "Clean post" like if the user would have pressed the submit buttom on a normal HTML page I don't need the result in the ASP application, the external site will take over from there. The syntax are ASP.net local application : form data is save in a local db ASP.net local application : A POST string is created ( I could create a FORM in real html but then the use has to press twice) The ...

is .net framework 1.1 same as .net framework SDK 1.1
is .net framework 1.1 same as  .net framework SDK 1.1 Basically Framework 1.1 of .NET includes the Sofware Development Kit (SDK) 1.1 http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET I think .net framework 1.1 is just the runtime library to view .net 1.1 programs.  the .net framework SDK 1.1 one is the actual development library used to create them.   Eri...

Upgrading from .NET 1.1 to .NET 2.0
Hi,We write ASP.NET applications for a large UK organisation for which we have two servers - a dev server and a live intranet server.  I would like to convince management to upgrade the .NET framework from 1.1 to 2.0 (and incidently VS2003 to VS2005).If we install the new version of the dotnet framework, will there be any issues with our existing 1.1 applications?  If so, what will the issues likely to be?Your help is greatly appreciated.Ryan Penfold, Truro, UK. Two versions can coexist, so you shouldn't have any issues. So far we have not had any real issues with asp.net 1.1 a...

.net 2.0 v. .Net 1.1
Hi all:Im trying to figure out whether I should begin using 2.0 at this point.  Many people I spoke to have indicated that it may be too soon (for whatever reason-bugs, hosting availibility etc).  Can someone give the pros and cons at this point?  I just learned .net 1.1 and this would be the first time I've ever gone throught this sort of transition.  Also, what was frustrating about 1.1 is that some of the books that first came out had alot of problems with their code working.  Is there an authorotative book out yet with functioning examples?Any help would be ...

Utilize .NET 2 [.net 1.1 installed]
Hi, My PC running Win XP (SP2), .Net Framework 1.1 and 2.0 and VS 2003. I am beginner in ASP.Net. When I try to used a ASP.Net 2 property with a control, shows me error and I also noticed .net framework ver. at the botton of broswer window. What should I do to utilize .net framework 2.0 functionality? Thanks First, you'll need Visual Web Developer or Visual Studio 2005 to create .NET 2.0 sites. In order to deploy a .NET 2.0 site, you'll need to set the .NET Framework version to 2.0 on the ASP.NET tab for the sites properties in IIS. HTH,RyanRyan OlshanASPInsider | Microsoft MVP, ASP.NET...

.NET 1.1 and .NET 2.0 on the same PC
I built my ASP.NET app and built it with .NET 1.1 I installed .Net 2.0 and now it will not function properly. How can I tell my App to use the .NET 1.1? Thanks for any help,Thank youJackxxx What tool are you using to code ASP.NET?Brian"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4). The PC i am referring to is my test PC and it has no tools. But I used VS.net 2003 on my development PC. Thank you,Thank youJackxxx Hi, Unfortunately, you can not run two...

Migration from .NET 1.1 to .NET 2.0
Hi All, Well i hoped that the migrating went smoother then is does so far. I had a few problem which i could fix with blogs from other developers, but i didn't find a good solution for this problem. Somehow i get the following error: "Make sure that the class defined in this code file matches the 'Inherits' attribute, and that it extends the correct base class" Well i worked very good before the migration. Some advise would be very welcome! Regards,Dennis van de Laarhttp://dennisv.net/Don't forget to mark the most helpful reply/replies as Answer. Maybe this post will hel...

Web resources about - .NET 1.1 and .NET 2 Perceives DB data differently - asp.net.sql-datasource

Facebook vs Twitter – How Smart Marketers Use Both Differently
The following is an excerpt. The complete article, available in our Facebook Marketing Bible, includes more key differences between Twitter and ...

What Amazing Leaders Do Differently
... to find myself surrounded by some incredible young leaders, be mentored by a few wise executives, and spend time What Amazing Leaders Do Differently ...

Selfiecity - Selfie differently! on the App Store on iTunes
Get Selfiecity - Selfie differently! on the App Store. See screenshots and ratings, and read customer reviews.

Defining targets differently - Flickr - Photo Sharing!
Different ambitions, skills and experience in defining targets Free download

Sex in the brain: do men and women think differently? - YouTube
Few today believe women are less intelligent, but some scientists say it's time to accept male and female brains are differently wired. With ...

'Everyone deals with grief differently': Bindi Irwin's rift with grandfather Bob Irwin
"People need to deal with grief how they need to deal with grief," says Bindi Irwin when asked about the rift with her grandfather. ...

IN GOOD COMPANY: What 11 CEOs would do differently if they were starting their careers again
Steve Atkinson, CEO and Founder, JustRideit.com.au would outsource company finances to the experts. What would you do? Established business leaders ...

What smart customers do differently to reduce bank fees
Low-income households are contributing a disproportionate amount to the banks’ healthy bottom line.

Men and women really do see things differently
FOR any woman who has ever despaired at her other half's choice of clothes, this may come as little surprise - the sexes see colours differently. ...

Brits chat, Americans work, Chinese sleep or shop: How we fly differently
For men, the most pressing issue before a trip is whether the flight will depart on schedule; for women, it’s getting to the airport on time—that’s ...

Resources last updated: 1/20/2016 1:59:06 PM