Category Archives: ASP.Net

Getting random List Items using LINQ

Today while writing test cases, I come to scenario, where I need to take random values from my generic list, and here is the snippet, which will randomly select (not exactly select, it is ordering) Happy coding

Posted in .Net, .Net 4.0, ASP.Net | Tagged , , , , | Leave a comment

ArgumentException – This row already belongs to another table

Today one of my colleague got this problem while copying datarow from one table to another, he just want to update few values of a same schema dataTable. So he used following method. He was getting an exception like “This … Continue reading

Posted in .Net, .Net 3.0 / 3.5, .Net 4.0, ASP.Net, Windows Forms | Tagged , , , , , | Leave a comment

How to add simple water mark to images

While working on one of my friend’s blog, I got a chance to write a code snippet which helps to add water mark for all images automatically. And I created a simple library do this. I added few extra options, … Continue reading

Posted in .Net, .Net 4.0, ASP.Net, Windows Forms | Tagged , , , , | 1 Comment

Fluent email library for c# using DynamicObject

Today I saw a StackOverflow question (Is there a fluent email library for c#?). And it has got few answers, so I thought of implementing a fluent email library for c# using DynamicObject;and here is a sample implementation. And here … Continue reading

Posted in .Net, .Net 3.0 / 3.5, .Net 4.0, ASP.Net | Tagged , , , | Leave a comment

How to get stack trace programmatically in C#

Stack information is very helpful to debug programs; this snippet will help to get stack trace. This is using System.Diagnostics namespace. Happy Debugging

Posted in .Net, .Net 3.0 / 3.5, ASP.Net | Tagged , , , | Leave a comment