June 2007 Entries
This article describes how to cache your SqlParameters. Using the SqlParameterCache allows you to increase efficiency of calling stored procedures and even on executing regular SQL queries!
Here is some code that demonstrates a very easy way to Encrypt and Decrypt using Rinjdael's (AES) algorithm. Also explains how to use a symmetric key, how to generate a Key and IV value, and real source code you can use in your application.
Positive and negative testing complement each other. Positive testing is testing that code does what it should. Negative testing is testing that code doesn't do what it shouldn't. Together, you get a holistic view of your code! Come explore these concepts with us, as we deal with the well-known greatest common factor algorithm.
How to search if a trigger contains certain text in SQL Server 2005:
SELECT OBJECT_NAME(id)
FROM syscomments
WHERE [text] LIKE '%your_search_here%' AND OBJECTPROPERTY(id, 'IsTrigger') = 1
GROUP BY OBJECT_NAME(id)
When designing a database, and creating the tables and schema, we have to choose carefully what we want our primary key to be. There are many different aspects to this. This article discusses the benefits of using a GUID over an Integer primary key.
When you use automated testing, the question arises: how can you write tests that are independant, and don't depend on other components (eg. database, login, etc.) working? The answer is: with mock objects.
An inside look at how Microsoft tests their code. For testing ASP.NET 2.0 and Visual Web Developer, they have ~105,000 test cases and ~505,000 functional test scenarios covered. Their team has approximately 1.4 testers for every 1 developer. Why? Because, They take quality pretty seriously at Microsoft, and because they have a lot of very hard requirements that necessitate careful planning and work to ensure high quality.
7 tips on how to create maintainable database queries. Create a data object, avoid stored procedures, build with stringbuilder, keep it together, code SQL over C#, use a SqlParameter Array, and Trust your judgement!
A summary of how to use Visual Source Safe (VSS) Pinning. Pinning is a feature that can be used to set a certain version as releasable, and when you run 'Get latest version' it will give you the pinned version, rather than the latest one, which may not be suitable for release yet. It also can be used in conjunction with Visual Source safe branching and sharing.
For a limited time, if you watch 2 Labcasts by Microsoft (90 minutes each), you can get a free licensed version of Visual Studio Standard Edition. Offer only applies in USA and expires June 30, 2007.
SqlDataReader can be used if you want to keep an open connection to the database and use the rows as they come to you (forward only stream of data). With SqlDataReader, you get the rows as they come, which can be handy if there is a lot of rows (say, millions), or if you have some sort of parallel processing you want to do while the data is still coming.
The C# global:: keyword (Global. in VB.NET) allows developers to differentiate between conflicting namespaces and classes.
If you've ever had two or more source-safe projects with shared files, you might be shocked to learn that Visual SourceSafe 2005 breaks one of the holy grails of good design: user expectations. But alas, Visual SouceSafe 2005 merges changes, not branches!
If you've ever had two or more source-safe projects with shared files, you might be shocked to learn that Visual SourceSafe 2005 breaks one of the holy grails of good design: user expectations.
You would expect that, if you delete a shared file from one project, it gets branched. I mean, you deleted it, right? But alas, Visual SouceSafe 2005 shares deleted files!
How to delete spam emails from your exim mail queue if its getting to large and full of spam. Use carefully.
grep -R -l [SPAM] /var/spool/exim/msglog/*|cut -b26-|xargs exim -Mrm
The runtime complexity of DataColumnCollection.Contains is O(1) for case sensitive lookup ,and O(n) for case insensitive lookup. O(1) means constant time, i.e. it is done same speed regardless of whether the dataset size is 10, or 10,000,000 records, and O(n) means it will run in a speed to the size proportional to the data you are running it on.