<feed version="0.3" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://purl.org/atom/ns#" xml:lang="en-US"><title>Khare, Atul</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/default.aspx" /><tagline type="text/html">A .NET Blog</tagline><id>http://dotnetjunkies.com/WebLog/dotnetruminator/default.aspx</id><author><url>http://dotnetjunkies.com/WebLog/dotnetruminator/default.aspx</url></author><generator url="http://communityserver.org" version="1.0.1.50214">Community Server</generator><modified>2004-09-01T09:40:00Z</modified><entry><title>RTM on top of Whidbey Beta2 (and an ode to Code Generation)!!!</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2005/06/27/128526.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:128526</id><created>2005-06-27T18:22:00Z</created><content type="text/html" mode="escaped">Our application was just deployed in production on top of Whidbey Beta2!!! In addition to being a Whidbey success story, our application is a showcase for code generation techniques (and the great CodeSmith 2.6). In our DataAccess layer (about 4000 lines of code), a total of 10 lines were written by hand and that too to retrieve DB connection strings from configuration files. If we had been building on top of 1.1, we would have even bigger numbers for autogenerated lines of code) -- Whidbey generics eliminate the need to write code to create specialized collections of objects.

In addition, we used xsd schemas to generate partial classes that were later extended using hand written code. If you ask me, creating a XSD file is much easier than defining a class and defining a whole bunch of get / set props (well, arguably the Whidbey IDE makes it trivial, but you get the point).

The XSDs were processed using xsd.exe and XsdObjectGen (from MS). Both of these tools generate code from XSD definitions, but they work slightly differently. In addition, we used a couple of small homegrown tools to slightly tweak the output using regex (to change the generated class to "partial" for instance). 

Also, it's pretty worthwhile to have a tool that generates code intelligently based on some of timestamp mechanism so that build doesn't take a long time.


&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=128526" width="1" height="1"&gt;</content><slash:comments>0</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=128526</wfw:commentRss></entry><entry><title>ASP.NET / COM Interop. puzzle...</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2005/02/22/56142.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:56142</id><created>2005-02-22T14:02:00Z</created><content type="text/html" mode="escaped">This might be rather obvious to quite a few people out there, but it's been a while since I have blogged and there's nothing like getting a kick start.

There’s a legacy COM object called Foo with a method called Enum(). Basically, Enum() enumerates certain things based on a user’s Windows identity and returns the result.  For example say Enum() returns x,y,z for UserA and d,e, f for UserB. You write a small standalone program to test Enum() under different user identitities and everything works just fine, i.e., it returns values that that pertain to UserA and UserB.
 
You create a web site and that web site uses integrated Windows authentication and impersonates the client (impersonate=true in web.config if you insist on details). You verify that impersonation is working correctly this by printing the user’s Windows identity from the web page.

However, when you execute the same code on the server side in the context of UserA or UserB, the COM component doesn’t work as expected, i.e., it doesn’t return the right result either user.

What’s happening here?
&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=56142" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=56142</wfw:commentRss></entry><entry><title>Whidbey System.Data.SqlClient.SqlConnection bug...</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/11/10/31636.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:31636</id><created>2004-11-10T21:57:00Z</created><content type="text/html" mode="escaped">The Whidbey System.Data.SqlClient.SqlConnection doesn't handle connections on non default ports correctly. Basically, if you create a DB on a SQL 2000 server, but host it on a non default port, say 3180, the GetConnection() method throws a SqlException with the following message :  "Unknown Provider Connection String is not valid". Check bug FDBK17272 on the Whidbey feedback site for more details.

The workaround for the problem is to prefix the server name in the connection string w/ tcp:.

Atul
&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=31636" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=31636</wfw:commentRss></entry><entry><title>UnhandledExceptionEventHandler quirk...</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/11/10/31630.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:31630</id><created>2004-11-10T21:19:00Z</created><content type="text/html" mode="escaped">Managed code programs can use AppDomain.UnhandledExceptionEventHandler to trap unhandled exceptions and it works great. 

However, there's an interesting quirk that might be of interest in situations where your managed code assembly (DLL) might be used inside an unmanaged process. It appears that for some reason, this event is NOT fired if an managed code exception is thrown inside an unmanaged process. Come to think of it, it kind of makes sense because the CLR needs to walk the entire call stack to find if an exception handler is in place and fire the event only if no exception handler is found. My guess is that the stack walk terminates if an unmanaged code frame is detected and the exception is swallowed.

Just out of curiosity, is this behaviour by design?&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=31630" width="1" height="1"&gt;</content><slash:comments>4</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=31630</wfw:commentRss></entry><entry><title>Win32 threads vs. Thread gotcha (and a little GC surprise)....</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/10/09/28176.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:28176</id><created>2004-10-09T23:21:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;During a recent code review, the following piece of C# code set off a red flag: &lt;/P&gt;void CreateAThread() &lt;BR&gt;{ &lt;BR&gt;Thread NewThread = new Thread(...); &lt;BR&gt;...//Assign ThreadStart etc... &lt;BR&gt;NewThread.Start(); //Long live the thread... &lt;BR&gt;} 
&lt;P&gt;The intention here is to create a new thread that will live till the process terminates. Come to think of it, such code would make perfect sense to someone who comes from a C++ background. &lt;/P&gt;For example, consider the following C++ code: &lt;BR&gt;void CreateAThread() &lt;BR&gt;{ &lt;BR&gt;HANDLE ThreadHandle = CreateThreadEx(.....); //Call Win32 API to create a thread.... &lt;BR&gt;CloseHandle(ThreadHandle); &lt;BR&gt;} 
&lt;P&gt;In the C++ case, the thread continues to run after return from the function. &lt;/P&gt;
&lt;P&gt;However, in the managed world, Thread is just another object and therefore NewThread is a reference that a prime candidate for GC. So, what happens when the GC collects a Thread() object? My guess was that the actual OS thread would be terminated by the Finalizer().&lt;/P&gt;
&lt;P&gt;To confirm my suspicion, I stepped into the code with a debugger and called GC.Collect() after exiting from CreateAThread(). Interestingly enough, the thread continued to run even after GC.Collect()!!! Is this because the GC has some buit in checks for such special type of objects? In any case, I think that it's bad practice to rely upon GC behaviour and it's imperative to assign the Thread reference alive for the lifetime of the thread. What do you folks think? Atul&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=28176" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=28176</wfw:commentRss></entry><entry><title>PInvoke ULONG gotcha...</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/07/24677.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:24677</id><created>2004-09-07T11:45:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Arial&gt;While doing PInvoke stuff, it's customary to cut and paste stuff from the C++ header file and translate the&amp;nbsp;native types into the corresponding C# types. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;However, as I discovered after many hours of debuggging a few weeks ago, looks can be deceptive ;). &lt;/FONT&gt;&lt;FONT face=Arial&gt;In Windows programming, it's&amp;nbsp;common to use ULONG (defined in windows.h)&amp;nbsp;instead of&amp;nbsp;unsigned long. Therefore, it must be right to translate ULONG into the ulong managed type, right? The answer is a resounding &amp;#8220;no&amp;#8220; -- ulong in the managed world is a full 64 bits, and therefore the&amp;nbsp;correct data type to use is uint.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;This is a subtle bug because you can get away w/ using ulong for a long time until it bites you. This is because at runtime, 64 bits will be pushed on the stack instead of 32 and if you have any pointer values (reference types)&amp;nbsp;that follow the ulong parameter, it can result in some strange behaviour that will leave you scratching your head.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;In this particular case, the API in question was:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Arial color=#ffff00&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;[DllImport("secur32.Dll", CharSet = CharSet.Auto, SetLastError = false)]&lt;BR&gt;static extern int AcceptSecurityContext(ref SECURITY_HANDLE phCredential,&lt;BR&gt;IntPtr phContext,&lt;BR&gt;ref SecBufferDesc pInput,&lt;BR&gt;uint fContextReq,&amp;nbsp; //managed ulong == 64 bits!!!&lt;BR&gt;uint TargetDataRep, //managed ulong == 64 bits!!!&lt;BR&gt;out SECURITY_HANDLE phNewContext,&lt;BR&gt;out SecBufferDesc pOutput,&lt;BR&gt;out uint pfContextAttr, //managed ulong == 64 bits!!!&lt;BR&gt;out SECURITY_INTEGER ptsTimeStamp);&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Since the pointer values were skewed, it resulted in an &amp;#8220;address access violation&amp;#8220; type exception in the unmanaged world, which was faithfully translated by the CLR into a runtime &amp;#8220;Null Pointer&amp;#8220; (or similar exception) :)....&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=24677" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=24677</wfw:commentRss></entry><entry><title>Oh MarshalAs(), where art thou? (new Interop book review)...</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/02/24223.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:24223</id><created>2004-09-02T09:44:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Arial&gt;Whether or not it has something to do w/ my COM/C++ karma :), I frequently seem to get assigned code that deals with Interop. In any case, I am not complaining because I enjoy that kind of stuff anyway (thanks to &lt;A href="http://www.amazon.com/exec/obidos/tg/detail/-/067232170X/qid=1094142730/sr=8-3/ref=sr_8_xs_ap_i3_xgl14/102-4059134-4170545?v=glance&amp;amp;s=books&amp;amp;n=507846"&gt;Adam Nathan's Bible &lt;/A&gt;for saving me a few gray hairs :).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Anyway, while browsing around a few days ago, I was pleasantly surprised to find a new Interop book on the block titled: &lt;A href="http://www.amazon.com/exec/obidos/tg/detail/-/078214134X/qid=1094143488/sr=1-1/ref=sr_1_1/102-4059134-4170545?v=glance&amp;amp;s=books"&gt;".NET Framework Solutions: In Search of the Lost Win32 API"&lt;/A&gt; (by John Mueller). I reckoned that at $8 (used on Amazon) it wouldn't be too bad of an investment. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;After reading the book, all that I can say is that if you are doing .NET -&amp;gt; Native Interop (PInvoke), this book should pretty have almost all that you need. Note that it does not cover COM (RCW) Interop in that much detail and does not talk about CCW (COM -&amp;gt; .NET). However, the coverage of MarshalAs() and the clever examples that show how to deal with the complex DirectX structures (unions and so forth) are alone worth the price of admission. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;What I liked best was the author didn't take the cop out solution (managed C++) unless it was absolutely necessary. Most of the code examples in the book are in C# and this might be of some concern to the VB.NET programmers. The chapters are well organized and there's an appendix with 50+ good tips on PInvoke. If you are still struggling with your PInvoke Interop problem after reading this book, it's time to bring out the &lt;A href="http://www.amazon.com/exec/obidos/tg/detail/-/067232170X/qid=1094142730/sr=8-3/ref=sr_8_xs_ap_i3_xgl14/102-4059134-4170545?v=glance&amp;amp;s=books&amp;amp;n=507846"&gt;heavy weight&lt;/A&gt;&amp;nbsp; -- good luck!!! &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=24223" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=24223</wfw:commentRss></entry><entry><title>Interop fun: SSPI in 100% managed C# code...</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/01/24013.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:24013</id><created>2004-09-01T13:38:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;Readers might want to reference the &lt;A href="http://pluralsight.com/wiki/default.aspx/Keith.GuideBook.WhatIsSSPI "&gt;SSPI chapter&lt;/A&gt; from Keith Brown's excellent&amp;nbsp;online book if they want to obtain more information. Anyway, MS published an &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/remsspi.asp"&gt;excellent article&lt;/A&gt; a while ago about how to&amp;nbsp;use SSPI in Remoting. &lt;/P&gt;
&lt;P&gt;My only reservation about the article was that some of the code was written in managed&amp;nbsp;C++ and I am a strong advocate of doing everyting in C# as much as possible. Anyway, since it appeared that other people have had trouble with the API, I decided that it would be an interesting exercise to port the C++ portions to C# and use PInvoke :).&lt;/P&gt;
&lt;P&gt;The actual code is a little too long to be included here, but if someone's interested, drop me a note a and I will mail the code - it does have a few interesting Interop tricks...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=24013" width="1" height="1"&gt;</content><slash:comments>5</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=24013</wfw:commentRss></entry><entry><title>CodeGen and compile time AOP... </title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/01/23974.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:23974</id><created>2004-09-01T10:33:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Arial&gt;Being a fan of the declarative programming, I have always been fascinated by the idea of AOP (Aspect Oriented Programming), but from the (failed) promise of COM+ interceptors (remember PDC 1999?) to the now deprecated CBOs (Context Bound Objects), it somehow hasn't fulfilled it's promise.&amp;nbsp; For the uninitiated, the idea is it should be possible to provide certain functionality say for logging or tracing, just by means of an declarative attribute.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;For example, instead of writing a typical call to a log or trace function like:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;MyMethod()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trace(&amp;#8220;I am in MyMethod();&amp;#8220;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&amp;nbsp;//Rest of method...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;we could use something like:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;[Trace]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;MyMethod()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&amp;nbsp;//Rest of method...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;FONT face=Arial&gt;Granted, it's a trivial example, but aspects can be used to provide more interesting behaviours like Transactions, Post Conditions and Preconditions as well (a la Design by Contract). Indeed, EnterpriseServices used the AutoComplete attribute to automagically provide a transaction context and automatic completion and rollback. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;So, if this is such a promising technology, where's the fly in ointment? For one thing, behaviour that's added at runtime can result in a severe performance penalty. Also, there may be &amp;#8220;quirks&amp;#8221; that may result from the interaction of such runtime behaviours (which may not be compatible w/ each other). In other words, if your software didn't behave as expected, would you blame your code or the &amp;#8220;aspects&amp;#8221;? And how would one go about debugging it?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;If only there were a way to not incur the performance hit and also make it easy to debug the code so that you could actually see what was going on.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;I think that's where static or compile time AOP comes into the picture. Watch this space for details...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=23974" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=23974</wfw:commentRss></entry><entry><title>Code generation anyone (a pitch for the excellent CodeSmith)? </title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/01/23965.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:23965</id><created>2004-09-01T10:14:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Arial&gt;With all the excellent code generation tools out there, it's really amazing that people still spend a whole bunch of time writing boiler plate code. What am I talking about here? &lt;BR&gt;&lt;BR&gt;Let's take a look at a typical three tier web application: &lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;Web UI Layer &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;BizFacade Layer &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;Biz Layer &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;DB Access Layer &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;SP &lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR&gt;&lt;FONT face=Arial&gt;In addition, since some people prefer dealing with objects rather DataSets, there's a Relational -&amp;gt; Object mapping layer that needs to be built. Naturally, where there are objects, there are collections and now we end up writing strong typed (of course) collections for each of those objects. &lt;BR&gt;&lt;BR&gt;So, to retrieve and display some data, we had to go through the process of writing the SPs, coding the DB access layer to call the SPs, writing the objects, writing the collections, writing the code that mapped DataSets -&amp;gt; Objects....whew!!! &lt;BR&gt;&lt;BR&gt;Is there something wrong with the picture here? Of course there is -- most or all of the things referenced the the above paragraph simply weren't meant to be written by hand. Or, if they were before, now is the time to STOP!!! &lt;BR&gt;&lt;BR&gt;Stop making excuses for letting brain dead code hold you hostage and download the excellent (and free!!!) &lt;/FONT&gt;&lt;A href="http://ericjsmith.net/codesmith/"&gt;&lt;FONT face=Arial&gt;CodeSmith&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; NOW!!! &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=23965" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=23965</wfw:commentRss></entry><entry><title>Whidbey SqlDataSource bug... </title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/01/23962.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:23962</id><created>2004-09-01T10:02:00Z</created><content type="text/html" mode="escaped">&lt;SPAN&gt;&lt;FONT face=Arial&gt;&lt;SPAN id=BugView_lblReproSteps&gt;&lt;FONT face=Arial&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;The problem is that SqlDataSource does not translate empty parameter string into DbNull.Value DateTime value. This behaviour is different from integers and strings, where an empty string is translated into DbNull.Value. You can check out the details and vote on the bug &lt;/FONT&gt;&lt;A href="http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?did=1&amp;amp;t=4nX8*APglDaRCKLwtCsr68hdfIUGdTE5Zew*RmWBO0ZZXQ5fmmR9RijmRAcWMCb06YBaAhDCXiPFuIO0gWS1CPmQ$$&amp;amp;p=4VXUWNdzNHgW1uVUYD8KS5GTUlR6MfjIBIvSnZQNen0Q9K8XBKenpT61uMRtuH3GdIIKW!xk4nn8zzl7rJ1EnuDOqXQUhmvoKDjDNvw6DWHlaT90kwDgE3GVu7vxMJNkQSdj1xbjl0UjE$&amp;amp;feedbackId=d5530517-39a4-43b6-a534-cac3c71a99db"&gt;&lt;FONT face=Arial&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; . &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Arial&gt;&lt;SPAN&gt;&lt;SPAN id=BugView_lblReproSteps&gt;&lt;?xml:namespace prefix = asp /&gt;&lt;asp:SqlDataSource id=SqlDataSource1 Runat="server" ProviderName="System.Data.SqlClient" ConnectionString="Server=localhost;Integrated Security=True;Database=Northwind" SelectCommand="CustOrdersOrdersAfterDate"&gt;&lt;/asp:SqlDataSource&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=23962" width="1" height="1"&gt;</content><slash:comments>5</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=23962</wfw:commentRss></entry><entry><title>Whidbey ASP.NET Literal control bug</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/01/23959.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:23959</id><created>2004-09-01T09:48:00Z</created><content type="text/html" mode="escaped">&lt;P&gt;&lt;FONT face=Arial&gt;For some reason, the ASP.NET Literal control doesn't like calls to server side scripts or Eval statements. Any call to a server side script fails with the following parse time message: 'System.Web.UI.WebControls.Literal' does not allow child controls. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;!--StartFragment --&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face=Arial&gt;&lt;SPAN id=BugView_lblReproSteps&gt;&amp;lt;%@ Page Language="C#" %&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;script runat="server"&amp;gt;&lt;BR&gt;public string CallMe()&lt;BR&gt;{&lt;BR&gt;return ("hi there");&lt;BR&gt;}&lt;BR&gt;&amp;lt;/script&amp;gt;&lt;BR&gt;&lt;BR&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;&lt;BR&gt;&amp;lt;head runat="server"&amp;gt;&lt;BR&gt;&amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;BR&gt;&amp;lt;/head&amp;gt;&lt;BR&gt;&amp;lt;body&amp;gt;&lt;BR&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;BR&gt;&amp;lt;% CallMe();%&amp;gt;&lt;BR&gt;&amp;lt;asp:Literal Runat=Server&amp;gt;&lt;BR&gt;&amp;lt;% CallMe();%&amp;gt;&lt;BR&gt;&amp;lt;/asp:Literal&amp;gt;&lt;BR&gt;&amp;lt;/form&amp;gt;&lt;BR&gt;&amp;lt;/body&amp;gt;&lt;BR&gt;&amp;lt;/html&amp;gt;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Please&amp;nbsp;vote on this bug:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackId=fe629cb4-9345-47fe-8073-817eb9351cc8"&gt;&lt;FONT face=Arial&gt;http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackId=fe629cb4-9345-47fe-8073-817eb9351cc8&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=23959" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=23959</wfw:commentRss></entry><entry><title>Whidbey System.Security.Cryptography enhancements...</title><link rel="alternate" type="text/html" href="http://dotnetjunkies.com/WebLog/dotnetruminator/archive/2004/09/01/23956.aspx" /><id>58df7014-fd75-437c-9641-150997716d1c:23956</id><created>2004-09-01T09:40:00Z</created><content type="text/html" mode="escaped">&lt;FONT face=Arial&gt;&amp;nbsp;Hi folks, &lt;BR&gt;&lt;BR&gt;This is my very first blog entry. Pardon the number of exclamation marks in this post,&amp;nbsp;but I downloaded Beta 1 of VS.NET a few weeks ago and but the improvements in System.Security.Cryptography are simply amazing!!! &lt;BR&gt;&lt;BR&gt;Here's a partial list of enhancements (this part&amp;nbsp;is not everyone's cup of Framework :): &lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;X509CertificateEx extends the X509Certificate class and lots of new properties like PrivateKey, Thumbprint, Extended Key Usage etc.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Arial&gt;X509Store allows you to browse cert stores and even add and remove certs!!! Well, arguably WSE 1.0/2.0 gave you the browse features, but this is much more!!!&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Arial&gt;There's complete support for CMS, meaning there's not need to muck around with CAPI for signed / enveloped messages etc.!!! Granted, CAPICOM was easier, but I would rather do things w/o having to resort to a RCW and have to deal with some of the nasty bugs (like Decrypt problems when dealing w/ string data)&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Arial&gt;Support for ASN1 encoded data!!!&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Arial&gt;Ability to generate PKCS12/PFX files from certificates!!!&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Here's a piece of trivia about &lt;FONT face="Times New Roman"&gt;X509CertificateEx.Export (from MS)&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;for people trying to export the entire certificate chain:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Thanks you for the feedback. X509CertificateEx.Export only exports the certificate itself and does not build the certificate chain. It is however possible to export the whole certificate chain with the set of APIs available today: what you could do is build a chain using X509Chain.Build; then get the certificates in the chain by accessing X509Chain.ChainElements. Once you get the collection you want exports, you can call X509CertificateExCollection.Export(). This method is the way to go if you need to export more than one certificate. &lt;/P&gt;
&lt;P&gt;&lt;/TD&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Atul&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=23956" width="1" height="1"&gt;</content><slash:comments>6</slash:comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/dotnetruminator/commentrss.aspx?PostID=23956</wfw:commentRss></entry></feed>