C# articles and tutorials on SharpDeveloper.NET

Sharpen your .NET skills with our C# articles, tutorials, demos, and source code by Sameer Alibhai
posts - 63, comments - 52, trackbacks - 1

June 2007 Entries

How To Use SqlParameterCache (Caching Sql Parameters)

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!

posted @ Friday, June 29, 2007 8:35 PM | Feedback (1) | Filed Under [ .NET articles SQL ]

Encryption and Decryption for Dummies in .NET

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.

posted @ Wednesday, June 27, 2007 6:21 PM | Feedback (0) | Filed Under [ .NET articles Deconstructing Subtext ]

Positive and Negative Testing in C#

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.

posted @ Wednesday, June 27, 2007 6:12 PM | Feedback (0) | Filed Under [ .NET articles Software Engineering ]

Search Trigger Text SQL Server 2005

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)

posted @ Tuesday, June 26, 2007 1:02 PM | Feedback (1) | Filed Under [ SQL ]

Guid Or Int Primary Key?

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.

posted @ Monday, June 25, 2007 6:14 PM | Feedback (1) | Filed Under [ SQL ]

Mock Objects for Dependencies

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.

posted @ Saturday, June 23, 2007 10:40 PM | Feedback (0) | Filed Under [ Software Engineering ]

An Insider's Look at Microsoft's Software Testing

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.

posted @ Friday, June 22, 2007 8:00 PM | Feedback (0) | Filed Under [ Software Engineering ]

Creating Maintainable Database Queries In C# (with source code)

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!

posted @ Friday, June 15, 2007 10:17 PM | Feedback (1) | Filed Under [ .NET articles SQL ]

Visual Source Safe Pinning Feature

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.

posted @ Tuesday, June 12, 2007 5:45 PM | Feedback (4) | Filed Under [ Visual SourceSafe ]

Free Visual Studio Standard Edition

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.

posted @ Monday, June 11, 2007 9:47 AM | Feedback (1) | Filed Under [ .NET articles ]

How to use SqlDataReader Plus Source Code

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.

posted @ Saturday, June 09, 2007 1:18 PM | Feedback (2) | Filed Under [ .NET articles ]

Proper use of global:: (or Global.)

The C# global:: keyword (Global. in VB.NET) allows developers to differentiate between conflicting namespaces and classes.

posted @ Friday, June 08, 2007 6:17 PM | Feedback (0) | Filed Under [ .NET articles ]

SourceSafe 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. But alas, Visual SouceSafe 2005 merges changes, not branches!

posted @ Wednesday, June 06, 2007 6:05 PM | Feedback (0) | Filed Under [ Visual SourceSafe ]

SourceSafe Shares Deleted Files!

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!

posted @ Wednesday, June 06, 2007 6:05 PM | Feedback (0) | Filed Under [ Visual SourceSafe ]

Delete Spam from Exim Queue

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

posted @ Tuesday, June 05, 2007 8:49 AM | Feedback (0) | Filed Under [ Hosting ]

Efficiency of DataColumnCollection.Contains

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.

posted @ Friday, June 01, 2007 10:37 AM | Feedback (1) | Filed Under [ .NET articles ]

Powered by: