Sponsored Links

Could not execute CVTRES.EXE

Today I started woking on a windows application at home and I was very annoyed by the error I was getting whenever I tried to debug/build the application that said: “Could not execute CVTRES.EXE”

Tried lots of things like giving full rights to “everyone”  on the debug folder and some other silly things, untill I found [...]

How to use OrderBy() for multiple columns in EntitySpaces?

You can pass multiple columns in like this:-

collection.Query.OrderBy(collection.Query.ProductID.Descending, collection.Query.CategoryID.Ascending)

How to manipulate Session in Http Handlers

There is a common issue that you can’t manipulate session objects in http handlers, the files with ASHX extension Well normally you can read the contents in the session via context.Session but you can add/remove/modify that in there. So how do you do this:

The answer is simple: Just implement the IRequiresSessionState interface. It [...]

How to get the file name from a full file path?

If you have a full file path like D:\My Documents\myimg.jpg and you want to get just the file name myimg.jpg, you can get it with the help of the Path class in this fashion:-

In C#

string filename = Path.GetFileName(“D:\My Documents\myimg.jpg“);
In VB .NET

Dim fileName as String = Path.GetFIleName(“D:\My Documents\myimg.jpg”)

A lost bet — Response.BinaryWrite Spoils the day!

Two days ago I lost a bet. My friend Jubair was generating a bar code image and he said how can I get it to display on the page without saving it as a file and giving its source to the image tag. I said you can’t do it because I thought it would be [...]

How to generate Random numbers in .NET

Actually these are not exactly ‘true’ random numbers. These are actually pseudo-random numbers, which means that they give you an illusion that they’re being generated randomly.

It’s very simple: There’s a class called System.Random. and the rest is as simple as this:-

Random r = new Random(0);
int num = r.Next(0,999999);

in VB .NET

dim r as Random = new [...]

How to Add Shaded Rows to ListView's Details View

Sometimes it can be challenging to read the Details view in a ListView, especially if the rows are long. This article shows how to add shading to every second row to make a ListView easier to read.

As you may know, you can alter the appearance of individual ListViewItem’s such as the Font and BackColor. But [...]

Properties in .NET

Property in C#:

Property ? it is a special method that can return a current object?s state or set it. Simple syntax of properties can see in the following example:

public int Old 
{
   get {return m_old;}
   set {m_old = value;}
 } 
public string Name 
{
   get {return m_name;} 
}

Here are two types of properties. A first one can set or get [...]

How to render a page's HTML?

I’ve been trying to get the Html of a gridview and in the process I found the way to get the Html of an aspx page @ Microsoft .NET Framework Group at Google. I’ve tested the code and now I’m trying to modify it to get the HTML of a gridview. Wish me luck!

 

<%@ Page [...]